[poppler] write smaller files

Albert Astals Cid aacid at kde.org
Thu Oct 20 08:08:33 PDT 2011


A Dimecres, 19 d'octubre de 2011, Axel Strübing vàreu escriure:
> 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.

We are trying no to touch anything of the poppler/ directory because at the 
moment we are working on merging xpdf-3.03 changes into poppler/ and the more 
things we change now the more difficult it will be finishing the merge.

What do you think of holding back the patch until we merge xpdf 3.03? Most 
probably i will forget about this patch so it would be cool if you could keep 
an eye on the list and once we announce the xpdf 3.03 merging is done you 
remind us of it ;-)

Albert

> 
> regards
> Axel


More information about the poppler mailing list