Hi thomas,
Thanks :-).Finally i got the solution as per you said.
This is my final code 

DOMImplementation domImpl = GenericDOMImplementation.getDOMImplementation();
String svgNS = "http://www.w3.org/2000/svg";;
Document document = domImpl.createDocument(svgNS, "svg", null);

File fil = new File("C:/htmlTest.svg");
SVGGraphics2D svgGenerator = new SVGGraphics2D(document);

svgGenerator.setSVGCanvasSize(new Dimension(500,500));
txtCompLbl.print(svgGenerator);

Element root = svgGenerator.getRoot();
root.setAttributeNS(null, "viewBox", "0 0 800 600");

PrintWriter savefile = new PrintWriter(new FileWriter(fil));
svgGenerator.stream(root,savefile, true,false);
savefile.close();
-- 
View this message in context: 
http://www.nabble.com/How-to-set-viewbox-attribute-in-SVGGraphics2D-tp24600865p24674114.html
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to