yob / pdf-reader

The PDF::Reader library implements a PDF parser conforming as much as possible to the PDF specification from Adobe.
MIT License
1.81k stars 271 forks source link

Ignore invalid '/Prev 0' in trailer #383

Closed sebbASF closed 2 years ago

sebbASF commented 2 years ago

I've seen this bug in a couple of PDFs which just contain an image. The various viewers I have tried seem to just ignore it.

No Creator entry, so don't know what app does this...

yob commented 2 years ago

Cheers, if other readers handle this issue then it'd be great for pdf-reader to as well.

Do you think we can get a spec in spec/integration_spec.rb for a file with this issue?

A trick/hack I often use is to generate a file with prawn, but modify my local copy of the pdf-core gem to tweak the way the PDF is serialised to disk. That might be an easy-ish way to add in a garbage /Prev 0 entry.