You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Albert Valls <av...@ngeografics.com> on 2001/09/13 17:22:51 UTC
SVGDocument to a SVG file
After modifying a SVGDocument I need to save the changes to a file. I suppose i have to use SVGGraphics2D but I'm not sure of this is the right way. Is there an easier way? Otherwise, how can I do it?
thanx.
Re: SVGDocument to a SVG file
Posted by Thierry Kormann <tk...@ilog.fr>.
On Thursday 13 September 2001 17:22, Albert Valls wrote:
> After modifying a SVGDocument I need to save the changes to a file. I
> suppose i have to use SVGGraphics2D but I'm not sure of this is the right
> way. Is there an easier way? Otherwise, how can I do it?
You have to use the SVGTranscoder which can take an SVGDocument and save it
into a stream (a Writer to be correct).
org.apache.batik.transcoder.svg2svg.SVGTranscoder
other classes are part of the org.apache.batik.transcoder package.
A simple example that should work:
TranscoderInput input = new TranscoderInput(svgDocument);
TranscoderOutput output = new TranscoderOutput(writer);
Transcoder t = new SVGTranscoder();
t.transcode(input, output);
Hope that helps,
Thierry.
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org