Hello Eliot,

Eliot Kimber wrote:
My overall requirement is that I have SVG graphic
documents that I want to render to PDF using an XSL-FO
engine that supports rendering of SVGs but does not
support hyperlinking from SVGs (that is, does not
implement the <a> element within SVGs).

I can get the link effect in FO by overlaying
absolutely-positioned blocks that are hyperlink
anchors over the graphic objects in the rendered SVG
but I have to know where a particular graphic object
will actually be rendered.

   The easiest way to do this is with just the
SVG DOM.  The Batik Wiki has directions on how
to 'boot' the SVG DOM without the canvas:

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

I'm trying to figure out how to do this with Batik--I
assume it can be done but I'm not yet seeing how to do
so from looking at the Javadocs and whatnot.

   Once you have the SVG DOM you can get the element
you want to get the bounds of (which could even be
an 'a' element - you might investigate DOM 2 core
'getElementsByTagNameNS').

   The bounds this returns will be in the 'local' coordinate
system (userspace) of the element you call it on.  You
can map this to the 'screen' with the getScreenCTM
method which will return an SVGMatrix which can be
used to map points from one coordinate system to another
(so map the corners of the bbox to the screen coordinate system).

   One issue you will need to deal with is how the
SVG is 'scaled' to the screen. I don't know how FOP
does this (fitting SVG to the available area).

Note that I don't want to do any visual rendering of
the SVG--I just need to get the rendered extent of the
graphic objects in the SVG.

If I understand the Batik packages I should be able to
do this with just the GVT layer. But I'm not seeing
how to go from an SVG document to a GVT tree directly.

My questions:

1. Is my overall approach sound or have I completely
misunderstood how to go about this?

2. Can someone point me to code or the specific
classes that will help get over this startup hurdle?

Thanks,

Eliot Kimber
Innodata Isogen

Eliot Kimber
Austin, TX

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to