Skip Menu |
 

This queue is for tickets about the PDF-API2 CPAN distribution.

Report information
The Basics
Id: 48683
Status: open
Priority: 0/
Queue: PDF-API2

People
Owner: Nobody in particular
Requestors: cherdt [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.73
Fixed in: (no value)



Subject: PDF-API2 throws error "Malformed xref in PDF file" for newer PDFs (PDF v1.5+)
Download (untitled) / with headers
text/plain 547b
Although PDF-API2 works well for older PDF formats (1.4), newer PDF formats (1.5, 1.6) cause it to throw error an error message: "Malformed xref in PDF file at [path to File.pm] line 1198" I can reproduce the error with the following Perl script: use PDF::API2; $pdf = PDF::API2->open($ARGV[0]); The PDFs I am using were produced by Adobe Acrobat Pro 9 (the attached is an example). I saw the possibly related bug report submitted by abhinavk, but his fix did not work for me. Environment: Perl v5.10.0 (ActiveState) on WinXP Pro 2002 SP3.
Subject: HowToArgueEffectively.pdf
Download HowToArgueEffectively.pdf
application/pdf 14.9k

Message body not shown because it is not plain text.

Subject: [rt.cpan.org #48683]
Date: Fri, 14 Aug 2009 11:41:47 -0500
To: bug-PDF-API2 [...] rt.cpan.org
From: Chris Herdt <cherdt [...] gmail.com>
Download (untitled) / with headers
text/plain 283b
I have since successfully used PDF::API2 to modify version 1.6 PDFs, so I'm not certain why the particular PDF in question produced the error. Perhaps that file in particular has an unfriendly xref value, which is apparently modified or removed when saved as an earlier PDF version.
Download (untitled) / with headers
text/plain 860b
On Fri Aug 14 12:42:10 2009, cherdt wrote: Show quoted text
> I have since successfully used PDF::API2 to modify version 1.6 PDFs, > so I'm not certain why the particular PDF in question produced the > error. Perhaps that file in particular has an unfriendly xref value, > which is apparently modified or removed when saved as an earlier PDF > version.
Since PDF 1.5, the spec changed to allow xref information to be in streams instead of tables. This isn't supported by PDF::API2 (though I'll be very happy if someone beats me to fixing that and sends a patch!). Acrobat 9 started using cross-reference streams by default, so this error is more common with newer files. PDF::API2 will work fine if you generate a PDF in Acrobat 9 without using cross-reference streams, however. The easiest way to do this is to make it compatible with Acrobat 5.0 and later when you save.
From: pwomack [...] papermule.co.uk
Download (untitled) / with headers
text/plain 577b
Show quoted text
> > Acrobat 9 started using cross-reference streams by default, so this > error is more common with newer files. PDF::API2 will work fine if you > generate a PDF in Acrobat 9 without using cross-reference streams, > however. The easiest way to do this is to make it compatible with > Acrobat 5.0 and later when you save.
With the passage of time, these are becoming more common. I looked into adding the cross-reference stream myself, but it is too complex to be a "patch"; it'a a significant piece of implementation. So can I just "+1" the importance of this. BugBear
Download (untitled) / with headers
text/plain 437b
Version 2.020, just released, contains two updates relevant to this issue: 1) If PDF::API2 encounters a cross-reference stream, it will now give a more appropriate error message rather than saying that the cross-reference table is malformed. 2) The Known Issues section of the POD contains pointers to the PDF specification, which describes how both the old cross-reference table works and how the new cross-reference streams work.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.