Closed micschk closed 3 years ago
I'm sure that this can be diagnosed and fixed easily, but I won't be able to do it without example files. Can you send me by email (john at coherent graphics dot co dot uk) a selection of input files, together with the merge command, and a subsequent command which fails?
(Your intuition that merging doesn't require 'rendering' and that, therefore, malformities in files can survive merging only to be problematic later is correct, by the way).
(Commercial license, CPDF v2.3.1) We see a strongly increased amount of errors when further processing merged PDFs in cpdf.
error Pdf.PDFError("Could not extract object"), will read as malformed
What we do is first merge a bunch of PDFs into one (works without problem). The errors occur when we further process the merged file, usually at the point where we -pad-after some blank pages, or -add-rectangle to a -range of pages (I guess at the point where the PDF actually has to be rendered by CPDF?).
Various errors may or may not occur at this point:
Processing all 'source' PDFs of the merged PDF individually with -pad-after and -add-rectangle works without any problems, my guess is that the merging somehow causes malformations. The resulting PDF seems to render just fine in eg Chrome. Also, when re-running the exact same steps again they may work just fine, or result in a comparable error (but not exactly the same).
Example output when using -gs-malformed;