xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "J.Pietschmann" <j3322...@yahoo.de>
Subject Re: OutOfMemoryError while rendering huge SVG
Date Wed, 08 Oct 2003 17:30:03 GMT
mathieu.fretiere@iworks.fr wrote:
> When the embedded svg is too large, I get a OutOfMemoryError while 
> rendering the current page.

It would be interesting to have details on what is considered
a "too large" SVG, and what parts are responsible for the overflow.
There are basically three possiblities:
- The SVG source creates a styled DOM so large that memory is already
  scarce before rendering is even attempted.
- Intermediate data structures become too large during rendering
- The rendered result swallows up a lot of memory.

I'd consider rendering the SVG outside of FOP into a bitmap image and
include the bitmap into the PDF.
In the first case, there might also be some room for reducing the SVG
source by reusing path definitions and possibly other stuff by using
references and clever transformations.
Another possibility is to set strokeSVGText to false
  http://xml.apache.org/fop/graphics.html#svg-pdf-text
which has potential to dramatically reduce the amount of memory
needed for the result, especially if the SVG contains lots of text.
> 
> What should I do :
> - should I use smaller embedded svg graphics in each page, rather than one 
> ? I don't know if it would help, because all graphics would remain in the 
> same page sequence.

It depends. Just try it.

> - should I use many external svg graphics ? (FOP would cache these 
> graphics).

I doubt this would work much better than embedding the SVG, but
you can try it too.

J.Pietschmann


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Mime
View raw message