Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with Batik

 
Velika Srbija
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I encountered a problem with rendering SVGGraphics2D content.
Here is the code snippet:
-----------------------------------------------------------
DOMImplementation domImpl = SVGDOMImplementation.getDOMImplementation();
String svgNamespaceURI = SVGDOMImplementation.SVG_NAMESPACE_URI;
Document document = domImpl.createDocument(svgNamespaceURI, "svg", null);
Element root = document.getDocumentElement();
root.setAttributeNS(null, "width", "450");
root.setAttributeNS(null, "height", "500");
SVGGraphics2D svgGenerator = new SVGGraphics2D(document);
svgGenerator.stream(new java.io.OutputStreamWriter(System.out, "UTF-8"), true);
-----------------------------------------------------------
The problem is that there are no "width" and "height" attributes in the root element "svg" of the generated DOM tree.
What is goin' on?
No errors, no exceptions, but they are missing.?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic