pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: Error signing document with reference table stream
Date Fri, 23 Mar 2018 19:49:53 GMT
Am 22.03.2018 um 18:58 schrieb Gabriel Madeira Pessoa:
> Hello everyone,
> While trying to sign PDFs created from many different sources we found 
> an unusual behavior with files generated with iText (older versions up 
> until 7.1.1) when they are created with full compression enabled (that 
> creates the xref table as a stream).

"older versions up until 7.1.1" - do you mean including 7.1.1 or except 
7.1.1 ? Because 7.1.1 is the latest version.

> iText does not add the the reference for the object of the xref table 
> inside the own table. That way, when signing with PDFBox (2.0.7, 2.0.8 
> and even 2.0.9 that I saw had its tagged created on github) 
> COSWriter.prepareIncrement does not know that the number of objects is 
> actually one higher than it had found, so the first entry on the 
> signature revision has the same number that the xref table on the 
> previous revision.
> With invisible signatures that does not looks like a problem, but when 
> we have a visible signature, the image does not show in in Microsoft 
> Edge or Google Chrome.
> PDFBox can get the actual highest number on PDFs created with xref 
> table stream that have its own reference inside.
> I'm actually in doubt which on is the correct table, with or without a 
> reference its own dictionary object.
> For a PDF that the table contains the reference we used the one from 
> PDFBOX-3198 just removing the signature (or use it as it is on the 
> ticket, because the image shows up on browsers).

PDFBOX-3198 has several PDFs. Which one do you mean?

> To create a iText PDF with xref table as stream just run:
> WriterProperties properties = new WriterProperties();
> properties.setFullCompressionMode(true);
> PdfWriter writer = new PdfWriter("doc.pdf", properties);
> PdfDocument pdf = new PdfDocument(writer);
> Document document = new Document(pdf);
> document.add(new Paragraph("Hello World!"));
> document.close();
> Thank you guys very much.

Ok, I'll test this...

I wonder if your problem is related to


To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org

View raw message