Re: [Printing-architecture] PDFio: Replaced QPDF by PDFio in libcupsfilters as GSoC project?

Michael Sweet <[email protected]> Mon, 11 Dec 2023 13:08:58 -0500
Newsgroups dev.linux.lists.printing-architecture
Message-ID <[email protected]>
Alex,

> On Dec 11, 2023, at 12:08 PM, Alex Korobkin <[email protected]> wrote:
> 
> Thank you, that's exactly what I needed. 
> I ran it against my collection of bad PDFs, and 10% of them failed with " Malformed xref table entry '0000000000 65536 f'."

The allowed range for generation numbers is 0-65535, so this is a bad PDF file. I can certainly allow a wider range of values (will require a small change to the internal representation) or just allow invalid values for object 0 but I'll want to understand the scope of the problem first...  Can you file a bug with a file or two that has this problem?

> I suppose that's the #1 point from your reply, so perhaps it's not too bad of an idea to reconstruct the xref table when possible?

No, the usual xref table issue is that the offsets are wrong, either from line ending changes or hand editing of the PDF file.

> It also reported "Too many object streams." for one file with 7000 pages, and "Unexpected 'startxref' token seen." on this file created by Till in 2013 to test various page sizes in a single PDF. 

Really?  The current code allows up to 4k object streams per xref table, and most files only have 1 or 2 (Acrobat will make 1 for the first page and 2 for the remaining pages in a linearized file).

Filed this as issue #58:

	https://github.com/michaelrsweet/pdfio/issues/58

________________________
Michael Sweet