= SVGDOMImplementation.getDOMImplementation();
Document doc = domImpl.createDocument(SVG_NAMESPACE_URI,
SVG_SVG_TAG, null);
SVGGraphics2D svgGenerator = new SVGGraphics2D(doc);
painter.paint(svgGenerator);
//
// Set the size and viewBox on the output document
//
int vpX = currentStore.getVpX();
int vpY = currentStore.getVpY();
int vpW = currentStore.getVpW();
int vpH = currentStore.getVpH();
svgGenerator.setSVGCanvasSize(new Dimension(vpW, vpH));
Element svgRoot = svgGenerator.getRoot();
svgRoot.setAttributeNS(null, SVG_VIEW_BOX_ATTRIBUTE,
"" + vpX + " " + vpY + " " +
vpW + " " + vpH );
//