[Poppler-bugs] [Bug 96529] PDFDoc::saveIncrementalUpdate() saves the trailer dict twice

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Jun 17 08:45:15 UTC 2016


https://bugs.freedesktop.org/show_bug.cgi?id=96529

Thomas Freitag <Thomas.Freitag at alfa.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |NOTABUG

--- Comment #5 from Thomas Freitag <Thomas.Freitag at alfa.de> ---
(In reply to Jakub Kucharski from comment #4)
> A bit more reading of PDF reference and:
> "In an incremental update, any new or changed objects are appended to the
> file, a
> cross-reference section is added, and a new trailer is inserted."
> So this seems ok. Sorry for the trouble. But to make it a bit clearer: why
> is the "0000000000 65535 f" (always) added (line 942 in poppler/PDFDoc.cc)?

You should read the spec carefully, then You will find the following sentence:

The first entry in the table (object number 0) shall always be free and shall
have a generation number of 65,535;

And if You look at the code in PDFDoc.cc You will encounter that it is just
done and then always if a new XRef() object is created to ensure this.

And it seems as if You haven't understand the PDFWriteMode parameter of saveAs.
If it is writeForceRewrite it will completely rewrite the complete PDF and You
will find just one trailerDict and xref section, otherwise it uses an
incremental update and just appends modified/new objects, of course the new
trailer dict and the xref section!

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler-bugs/attachments/20160617/205c6841/attachment.html>


More information about the Poppler-bugs mailing list