Hi Kai,

Kai Grabfelder wrote:

i'm trying to load an existing svg file and add some drawings to it, using
the SVGGraphics2D class

but i want to have an existing svg document as a template (i just want to
draw on top of it) and so i tried

String parser = XMLResourceDescriptor.getXMLParserClassName();
SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser);
String uri = "test.svg";
Document document = f.createDocument(uri);
SVGGraphics2D svgGenerator = new SVGGraphics2D(document);
//following some drawings on the svgGenerator object

but the resulting svg document does not consists of any elements present in
the test.svg input file.

This is what you want to do but the SVGGraphics2D only uses the given Document as a factory it does not automatically append it's output into the Document. You would need to do this when the drawing is done with something like:

    svgGenerator.getRoot(document.getDocumentElement());

my question:

is it possible to draw on top of an existing svg file using SVGGraphics2D
and if not how is it possible then? Do i have to use JSVGCanvas? (since i
only need to create the svgs on the server side i thought this would not be
neccessary...)

No you don't need to use the JSVGCanvas.


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



Reply via email to