Hi Sudhakar,
Sudhakar S <[EMAIL PROTECTED]> wrote on 08/01/2006 02:45:37 AM:
> Changing 'image' element to 'svg' will affect lot of places in my code.
so i
> have forced to use the alternate option with SVGGraphics2D. But when use
the
> following code to export to SVG file, it is not exporting properly. It
means
> it contains only svg tag(<svg ...> </svg>).
>
> DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
> final Document svgDoc = DOMUtilities.deepCloneDocument(_document, impl);
>
> SVGGeneratorContext ctx = SVGGeneratorContext.createDefault(svgDoc);
> SVGGraphics2D svgG2d = new SVGGraphics2D(ctx, false);
> svgG2d.setSVGCanvasSize(new Dimension(_width, _height));
> Element root = svgDoc.getDocumentElement();
> svgG2d.getRoot(root);
Calling 'getRoot' appends the contents of the SVGGraphics2D
to the given Element and clears the SVGGraphics2D for further
drawing. I suspect it will work as desired if you simply remove
this line of code.
> svgG2d.stream(fileName, useCSS);
> svgG2d.dispose();
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]