[poppler] write smaller files

Axel Strübing axel.struebing at freenet.de
Wed Oct 19 09:16:05 PDT 2011


Dear popplers,

maybe it is of no great relevance, but I prepared a patch (attached) to save 
space in files written by 'saveCompleteRewrite' in case the input uses  
'Cross-Reference Streams'
and  'Object Streams'.

In the current state every object from the input is read into the xref-table 
and independently saved into the output file. This applies to object streams, 
too. When each object is saved conventionally, and a standard xref section is 
written to the new file (), there is no need to write the object streams and 
reference streams to it.

This applies to the linearization dictionary, which is invalidated by a 
rewrite, too.

The attached patch introduces two helpers in Linearization.cc/Linearization.h 
and XRef.h  to get object number of linearization dict and xrefstream flag, 
respectively. Than changes 'saveCompleteRewrite' to not write content of 
object streams, reference streams and linearization dictionary into the 
output, but mark the coresponding objects as free.

The patched poppler works fine for my limited test cases.

I want to ask if someone more knowledgeable than me 
could check for possible implications.

Feel free to change anything. Any thoughts are welcome.

regards
Axel


More information about the poppler mailing list