xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Barry <barry_whit...@londonmarketing.com>
Subject Get node list from an exisitng svg
Date Mon, 08 Sep 2008 14:23:18 GMT
Hi there

I wondered if anybody could help at all.  I have an existing svg file
that is very large and I wish to reteive a nodelist of a certain area so
that I can create a new svg of a small section.

I have loaded the svg into memory and have defined a rectangle but I am
having problems with the getIntersectionList as I keep getting null
returned.

Here is a section of the code I think Im doing wrong but any help would
be gratefully received.

SVGRect rectangle = this.originalSVGRoot.createSVGRect();
		rectangle.setX(new Float(this.topXPosition));
		rectangle.setY(new Float(this.topYPosition));
		rectangle.setWidth(new Float(this.imageWidth));
		rectangle.setHeight(new Float(this.imageHeight));

		SVGElement croppableElement =
(SVGElement)this.svgDocument.getRootElement();
		NodeList croppedNodes =
this.originalSVGRoot.getIntersectionList(rectangle, croppableElement);
		System.out.println("NODES in THE crop OBJ: " +
croppedNodes.getLength());

Thanks

Barry

Mime
View raw message