Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

CAM::PDF %PDF-

by fionbarr (Friar)
on Nov 11, 2009 at 18:25 UTC ( #806564=perlquestion: print w/replies, xml ) Need Help??

fionbarr has asked for the wisdom of the Perl Monks concerning the following question:

I am having (generally) good results with CAM::PDF but a LOT of the files I am trying to read have the error
"Content does not begin with \"%PDF-\"\n";
what's the chance of ignoring this error and trying to continue?

Replies are listed 'Best First'.
Re: CAM::PDF %PDF-
by Corion (Patriarch) on Nov 11, 2009 at 18:31 UTC

    If the file does not start with %PDF-, it's not a PDF file. So I would assume that your chances are pretty slim to none.

    Have you considered actually looking at the file contents?

      ah ha! Adobe reader (trying to open this file) says that the file 'has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded. I'll try to open it and look at it otherwise. Thanks
Re: CAM::PDF %PDF-
by shenme (Priest) on Nov 11, 2009 at 22:20 UTC
    I ran into problems with CAM::PDF and others, as apparently Adobe specified that line endings must be only '\n', and not the often seen '\r\n'. Thus if a file passed through something that 'translated' line endings, the strict matching would fail. Differences between specifications, specification documents, and the real world. (sigh)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://806564]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2022-12-04 19:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?