Forum Bugs

pypdf issue

cayhorstmann
Hi, I am trying to use pdfstitcher (https://github.com/captn3m0/pystitcher/wiki) for combining several PrinceXML-generated PDF. But I get an error message, similar to this: https://stackoverflow.com/questions/45978113/pypdf2-write-doesnt-work-on-some-pdf-files-python-3-5-1/52687771#52687771

When I load and save the PDF with Master PDF Editor, making no changes, then pdfstitcher works. So it seems that it doesn't like some aspect of the PrinceXML generated PDF.

Another remedy is to use pdfunite to read and write the file, which gives warnings such as "reported number of objects (192) is not one plus the highest object number (210)" but produces files that pdfstitcher will read.

Is there some known way to tweak the Prince output format so that it is more to the liking of those PDF tools?

Or is there a simpler way for me to make an outline directly with Prince?

This is with version 14.2.

Thanks,

Cay
mikeday
We will investigate this issue.
wangp
pdfstitcher is likely only reading one of two xref tables in the PDF. Prince generates two xref tables when using object streams, to maintain compatibility with very old PDF viewers. You can call Prince with --no-object-streams to disable use of object streams, and work around the problem.
cayhorstmann
Thanks, that flag fixes the issue.