These notes apply to <fo:external-graphic> under FOP 0.20.1:

o FOP images are kept as XObjects until the end of job, because
        - the image is written to the output file
        - and the complete image object is added to the XObjects vector in order to
build the ressource dictionary at the end of the PDF document.

But the ressource dictionary needs only PDF object references - not the
images themselves. So if the addImage-method of PDFDocument-class is changed
like this, only images within a page are kept in memory.

old code:  this.xObjects.add(xObject);
           this.xObjectsMap.put(url, xObject);   deleted: does not hurt,
because never written

new code:  this.xObjects.addElement(new PDFXObject(this.objectcount,
this.xObjectCount)); // just adding an object ID as reference does it

Still memory usage rises from start to end of job: most likely FOP images
hang forever uncompressed in the area tree.

Hansuli Anderegg

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to