How can I set the viewBox attribute using the
SVGGraphics2D classes?
I want to set the viewBox on an SVG created with the
SVGGraphics2D class, so that the image will scale.
I have tried the following:
// Create an instance of org.w3c.dom.Document
Document document = domImpl.createDocument( null, "svg", null);
//This viewBox attribute never appears.
Element el = document.getDocumentElement();
el.setAttributeNS(null, "viewBox", "0, 0, 600, 400" );
System.out.println( document.getDocumentElement().getAttribute(
"viewBox" ) );
// Create an instance of the SVG Generator
SVGGraphics2D svgGenerator = new SVGGraphics2D(document);
but it doesn't work - the attribute disappears.
chris.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]