xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Max Weis <maxatdr...@gmail.com>
Subject Path-Data from SVG not complete
Date Thu, 20 Mar 2014 21:07:43 GMT
<http://batik.2283329.n4.nabble.com/file/n4655935/postSVG.jpg> 



Hello, 
I try to parse the path data from an SVG file into a (JAVA) shape. 
the result is, however, as can be seen in the images is not complete. 
Can you tell me if I do something wrong e.g.when iterating the d-attributes? 


CODE:


String parser = XMLResourceDescriptor.getXMLParserClassName();
	    SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser);

	    Document doc = f.createDocument(getClass().getResource(path)
		    .toString());

	    PathParser pp = new PathParser();
	    AWTPathProducer ap = new AWTPathProducer();
	    pp.setPathHandler(ap);

	    NodeList nl = doc.getElementsByTagName("path");

	    for (int i = 0; i < nl.getLength(); i++) {
		Element elm = (Element) nl.item(i);

		// Get path data
		String pathData = elm.getAttribute("d");
		pp.parse(pathData);



--
View this message in context: http://batik.2283329.n4.nabble.com/Path-Data-from-SVG-not-complete-tp4655935.html
Sent from the Batik - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Mime
View raw message