|Subject:||PDF::API2 - Problem reading in pdf file|
|Date:||Thu, 01 Nov 2007 17:18:42 +0100|
|From:||Gregor Retti <firstname.lastname@example.org>|
When trying to read a certain pdf file (attached) I got the following error: Malformed PDF file FileHandle=GLOB(0x90a8fcc) at /usr/lib/perl5/site_perl/5.8.4/PDF/API2/Basic/PDF/File.pm line 318. It looks like the end of the pdf should not be startxref 146169 %%EOF but rather startxref 146169 %%EOF The pdf is produced by a clipping software so I can not do much about that. When I added a space as an alternative to the check in File.pm it worked: 317c317 < if ($buf !~ m/startxref$cr\s*([0-9]+)$cr\%\%eof.*?/oi) ---
Show quoted text
> if ($buf !~ m/startxref$cr| \s*([0-9]+)$cr\%\%eof.*?/oi)Not a very elegant solution, but it seems to work. -- Gregor Retti, Ph.D. Innsbruck Medical University EMail: email@example.com
Message body not shown because it is not plain text.