PDF does not contain EOF marker (PDF::Reader::Malf

2020-07-13 08:27发布

问题:

I am using ‘pdf-reader’ gem to read raw contents of pdf documents so I can post (http-post) them to an API. To confirm the API implementation can create a valid pdf document from the raw content, I wrote a small gist to validate my code to read the pdf content.

For some reason, I always keep getting ‘PDF does not contain EOF marker (PDF::Reader::MalformedPDFError)’.

Can anyone point me out where I am going wrong?