xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.dewe...@kodak.com
Subject Re: Extract more than 1000 areas fron svg
Date Tue, 31 Mar 2009 09:56:47 GMT
Hi Sergey,

Захаров Сергей <cyber_neo@2energies.com> wrote on 03/30/2009 05:41:53 AM:

> I have big SVG file about 2300x3200 dimension and I want get little 
> areas from it and save them to jpg but my problem is in slow 
> transcode of each area.
> I think this trouble because every time all svg file upload to 
> memory. How can I save it in memory until getting areas.

    A lot of how to approach this depends on what support you
need.  The simplest approach would be to take the 'Boot SVG and CSS DOM'
code which will build the GVT tree.  Then you can create your tile
as a BufferedImage get a Graphics2D from that BufferedImage.

    You can then translate the Graphics2D and call the paint method
on the root GraphicsNode - this will fill the BufferedImage with the
related Image content.  You can then encode the BufferedImage translate
the Graphics2D and call paint again...

    This of course doesn't benefit from viewBox fitting, or setting
any rendering hints but it's the simplest way to get control of the
rendering of an SVG document.

View raw message