PDF-API2 - not a PDF file version 1.x

Posted on Tue Mar 15 01:11:46 2005 by ranxerox
not a PDF file version 1.x

I've got some PDF files that have hex B0 instead of a newline (hex 0D or 0D0A) at the end of the header line. PDF::API2 barfs on this. As it should, sort of, but I'd rather it accepted them.

I've tracked the code down to PDF::API2::Basic::PDF::File line 350 in open_swallowed(). The pattern is actually a variable:

$PDF::API2::Basic::PDF::File::cr

So in my code I add the line:

$PDF::API2::Basic::PDF::File::cr = qr($PDF::API2::Basic::PDF::File::cr|\s*\xB0);

This works for me. Isn't Perl wunnerful?

Write a response