Skip Menu |

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

Report information
The Basics
Id: 47974
Status: resolved
Priority: 0/
Queue: PDF-API2

People
Owner: Nobody in particular
Requestors: abhinavk [...] stratify.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 2.022



Subject: PDF::API2 fails when xref section has spaces around object index and count.
For PDF files that have cross reference section as xref 0 91 # *spaces around obj index and count* 0000000000 65535 f 0000004265 00000 n 0000004160 00000 n 0000000009 00000 n 0000141765 00000 n PDF::API2 fails with malformed trailer error. When you modify the pdf file to remove the space like below, it works fine. instead of xref 0 91 0000000000 65535 f 0000004265 00000 n 0000004160 00000 n 0000000009 00000 n 0000141765 00000 n The producer application for the pdf was JAWS PDFLib and pdf version 1.3
attaching an example PDF (cannot post the original PDF due to company policies. I have created a new pdf with the same problem)
Subject: isc07cc.pdf
Download isc07cc.pdf
application/pdf 141.7k

Message body not shown because it is not plain text.

My workaround for the problem is PDF\API2\Basic\PDF\File.pm 1266c1266 < while ($buf =~ m/^([0-9]+)$ws_char+([0-9]+)$cr(.*?)$/so) --- Show quoted text
> while ($buf =~
m/^$ws_char*([0-9]+)$ws_char+([0-9]+)$ws_char*$cr(.*?)$/so)
Thanks (rather belatedly) for the bug report and patch. Based on my reading of the PDF specification, extra spaces aren't allowed on that line. However, since the fix is unambiguous and doesn't add much overhead, I've added it anyway (with a warning so that the producer can be fixed). This change will be included in the next release.