This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Struts and the fly likes Problem with Batik Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem with Batik" Watch "Problem with Batik" New topic
Author

Problem with Batik

Velika Srbija
Ranch Hand

Joined: Jan 15, 2002
Posts: 172
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.?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Problem with Batik
 
It's not a secret anymore!