Don,

The SVGGraphics2D does not populate the Document you gave it at
construction time. It is only used as a factory for creating all
the SVG content.

What you'll have to do is get the root from the SVGGraphics2D
(getRoot method) and append it to your 'svgRoot'.

Good luck,
Vincent.

Don Willems wrote:
> 
> Hi,
> I have a problem with using the setSVGDocument method in JSVGCanvas.
> The SVG document that I want to render on the JSVGCanvas is generated by
> my program. When I want to render that document nothing seems to happens
> (if I use listeners on the canvas I can see that the document is build,
> and then rendered, but nothing is shown on the canvas).
> I have tried to render SVG documents from a URI and that works. I have
> also tried to save the SVG document generated by my program to a file
> and that works also (I can view the SVG perfectly in Adobes Viewer).
> 
> What do I have to do to get the setSVGDocument method to work?
> 
> My code:
> 
>              DOMImplementation domImpl =
> SVGDOMImplementation.getDOMImplementation();
>              String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
>              Document document = domImpl.createDocument(svgNS, "svg",
> null);
>              SVGGraphics2D svgGenerator = new SVGGraphics2D(document);
>              paintRenderer(svgGenerator);       //--> paints shapes on the
> graphics context
>              Element svgRoot = document.getDocumentElement();
>              svgRoot.setAttributeNS(null, "width", "400");
>              svgRoot.setAttributeNS(null, "height", "450");
> 
>          setSVGDocument((document);
> 
> Many thanks,
> Don
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

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

Reply via email to