You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The trailer dictionary is missing the required trailer keyword, i.e. lopdf outputs << /Root 5 0 R/Size 6 ... >> instead of trailer<< /Root 5 0 R/Size 6 ... >>
lopdf doesn't output any standard plain-text xref table? In every newly PDF generated by lopdf, there is no xref table, only an /XRef stream on the trailer dictionary.
There are two ways in the spec to write the cross-reference information, the "old" way as an xref table and the "new" (since PDF1.5) way as a cross-reference stream.
The default way that lopdf does it is via the cross-reference stream. The stream does not require the trailer keyword (cf. 7.5.8 Cross-reference streams).
The value following the startxref keyword shall be the byte offset of the cross-reference stream rather
than the xref keyword. For PDF files that use cross-reference streams entirely ([..]), the keywords xref and trailer shall no longer be used.
If you prefer the classical xref table over cross-reference streams, you can configure lopdf to output those instead by changing the xref type:
I couldn't reproduce the issue by myself. Could you maybe post some way to reproduce your issue?
PS: The PDF in your linked issue is not spec compliant because it is only PDF1.3 which are not allowed to have cross-reference streams (only since PDF1.5). If you don't have the specific requirement to use PDF1.3 I highly recommend switching to at least PDF1.7. By now, PDF1.7 is 16 years old, so all readers should be able to handle it.
Thank you. It's not really about the age of the PDF standard, it's just that some PDF standards are set for a specific conformance and for print proofing, so Acrobat will spit out errors when sending the PDF file to a printing company.
trailer
keyword, i.e. lopdf outputs<< /Root 5 0 R/Size 6 ... >>
instead oftrailer<< /Root 5 0 R/Size 6 ... >>
/XRef
stream on the trailer dictionary.This leads to errors in some PDF viewers, see mozilla/pdf.js#19007
The text was updated successfully, but these errors were encountered: