Closed averms closed 1 year ago
I tried ghostscript on it, which reported no errors. It's normally very good at Xref error reporting.
However, I ran fin.pdf through https://www.pdf-online.com/osa/validate.aspx which showed:
Validating file "fin.pdf" for conformance level pdf1.5
The key Count is required but missing.
The value of the key Count is 0 but must be 3.
So I will fix that first, and then send you a new executable. You can then run it through your jhove
tool and see what happens.
I looked into jhove
and it seems old and half-abandoned, so I'm not inclined to trust its exact error message -- especially when other tools would spot an "invalid object number", but do not report one -- and if cpdf were generating invalid object numbers, it would have doubtless been reported before.
Please let me know what platform you're using.
I'm not too tied to Jhove. Was just using that because I didn't know anything better existed. I might start using that pdf-online website from now on.
My platform is 64 bit Arch Linux.
The pdf-online error is bogus, in turns out. I'm looking again at the jhove one.
Jhove is being confused by null objects inside an object stream.
It's perfectly valid to have them, but it's not clear why adding the bookmarks is retaining these, and we would like to get rid of them.
Marking for the next release.
gorge:keycount john$ cpdf -list-bookmarks out.pdf >b.txt
gorge:keycount john$ cpdf -add-bookmarks b.txt out.pdf -o out2.pdf
gorge:keycount john$ cpdf -add-bookmarks b.txt mwe.pdf -o out2.pdf
gorge:keycount john$ cpdf -decompress out2.pdf -o decomp.pdf
gorge:keycount john$ mvim decomp.pdf <-- see too many nulls in objstm.
Description
Exporting and then importing bookmarks (without changing anything) breaks jhove validation.
Steps to reproduce
cpdf mwe.pdf -list-bookmarks >b.txt
cpdf mwe.pdf -add-bookmarks b.txt -o fin.pdf
jhove -m pdf-hul fin.pdf
The output is
The original file, mwe.pdf, validates fine. It was created with PDFLaTeX and hyperref.