You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by John Pybus <jo...@pybus.org> on 2005/05/07 20:17:34 UTC

rendered position of elements in an SVG document

Hi,

I'm new to programming with Batik.  I'd like to determine the final 
rendered position of particular elements in an SVG document.  I 
understand that I can parse the document into a DOM, and think I then 
need to use the bridge package to associate the DOM with gvt Nodes which 
I can query.  Am I on the right track, and how would I go about doing 
this?  The documentation is a bit light in this area.

Many thanks,

John


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


Re: rendered position of elements in an SVG document

Posted by John Pybus <jo...@pybus.org>.
Thomas DeWeese wrote:
> Hi John,
> 
>    Take a look at the Batik Wiki - in particular:
> 
>     http://wiki.apache.org/xmlgraphics-batik/BootSvgAndCssDom

Thank you!!  That was _exactly_ the bit I was struggling to work out 
from the API javadoc.



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


Re: rendered position of elements in an SVG document

Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi John,

    Take a look at the Batik Wiki - in particular:

	http://wiki.apache.org/xmlgraphics-batik/BootSvgAndCssDom


John Pybus wrote:
> Tonny Kohar wrote:
> 
>> On Sat, 2005-05-07 at 19:17 +0100, John Pybus wrote:
>>
>>> I'm new to programming with Batik.  I'd like to determine the final 
>>> rendered position of particular elements in an SVG document.  I 
>>> understand that I can parse the document into a DOM, and think I then 
>>> need to use the bridge package to associate the DOM with gvt Nodes 
>>> which I can query.  Am I on the right track, and how would I go about 
>>> doing this?  The documentation is a bit light in this area.
>>
>>
>> I think you are correct.
> 
> 
> Glad to hear I'm on track.  My question is really how do I go about 
> setting up the SVG/GVT Bridge; I'm not transcoding the SVG to anything 
> else or rendering to an image, I just want to query positions.  If I 
> simply load my SVG into a batik DOM and query svgElement.getBBox() I get 
> null pointer exceptions.
> 
> John
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
> 


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


Re: rendered position of elements in an SVG document

Posted by John Pybus <jo...@pybus.org>.
Tonny Kohar wrote:
> On Sat, 2005-05-07 at 19:17 +0100, John Pybus wrote:
> 
>>I'm new to programming with Batik.  I'd like to determine the final 
>>rendered position of particular elements in an SVG document.  I 
>>understand that I can parse the document into a DOM, and think I then 
>>need to use the bridge package to associate the DOM with gvt Nodes which 
>>I can query.  Am I on the right track, and how would I go about doing 
>>this?  The documentation is a bit light in this area.
> 
> I think you are correct.

Glad to hear I'm on track.  My question is really how do I go about 
setting up the SVG/GVT Bridge; I'm not transcoding the SVG to anything 
else or rendering to an image, I just want to query positions.  If I 
simply load my SVG into a batik DOM and query svgElement.getBBox() I get 
null pointer exceptions.

John



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


Re: rendered position of elements in an SVG document

Posted by Tonny Kohar <to...@kiyut.com>.
Hi,

On Sat, 2005-05-07 at 19:17 +0100, John Pybus wrote:
> I'm new to programming with Batik.  I'd like to determine the final 
> rendered position of particular elements in an SVG document.  I 
> understand that I can parse the document into a DOM, and think I then 
> need to use the bridge package to associate the DOM with gvt Nodes which 
> I can query.  Am I on the right track, and how would I go about doing 
> this?  The documentation is a bit light in this area.

I think you are correct.

- For pure SVG DOM you can query svgElement.getBBox()
- For Batik SVG/Bridge/GVT you can query gvtNode.getBounds()

Regards
Tonny Kohar
-- 
Sketsa 
SVG Graphics Editor
http://www.kiyut.com


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