You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Jason R Briggs <ja...@rhe.co.nz> on 2006/07/11 07:49:35 UTC

clickable SVGs

Hi All

One of my colleagues has a problem with an SVG chart in a PDF which 
needs to be clickable -- a click on the chart jumps to another page in 
the pdf.  The SVG is created using Java2d and Batik (batik's SVG 
generator).  Weirdly, only the text at the bottom of the chart is 
actually clickable -- there are 2 rows of text at the bottom (but still 
part of the SVG xml) and only the last row can be clicked on.

The xsl-fo begins something like this:

<fo:basic-link show-destination="new" internal-destination="InferenceData">
    <fo:inline>
        <fo:instream-foreign-object>
            <svg xmlns="http://www.w3.org/2000/svg" ...

I've done a test with a much smaller SVG graphic and an external link 
(below) and this seems to work okay.  Although when clicking it still 
looks like only the bottom half of the graphic is actually highlighted.

<fo:basic-link show-destination="new" role="An Example" 
external-destination="http://www.yahoo.com">
    <fo:inline>
        <fo:instream-foreign-object><svg:svg width="3mm" height="3mm" 
viewBox="0 0 30 30">
            <svg:circle cx="15" cy="15" r="7" fill="#0000ff" 
stroke="none" stroke-width="0"/></svg:svg>
        </fo:instream-foreign-object>
    </fo:inline>
</fo:basic-link>

Has anyone else had similar problems with basic-links surrounding SVG 
graphics?

Thanks,
Jason

PS.  Using latest version of FOP from svn head

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


Re: clickable SVGs

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
You're right. Something's not right here. I've added a testcase that
shows the problem: http://svn.apache.org/viewvc?rev=420759&view=rev
Shouldn't be too hard to fix but I don't have time right now.

On 11.07.2006 07:49:35 Jason R Briggs wrote:
> Hi All
> 
> One of my colleagues has a problem with an SVG chart in a PDF which 
> needs to be clickable -- a click on the chart jumps to another page in 
> the pdf.  The SVG is created using Java2d and Batik (batik's SVG 
> generator).  Weirdly, only the text at the bottom of the chart is 
> actually clickable -- there are 2 rows of text at the bottom (but still 
> part of the SVG xml) and only the last row can be clicked on.
> 
> The xsl-fo begins something like this:
> 
> <fo:basic-link show-destination="new" internal-destination="InferenceData">
>     <fo:inline>
>         <fo:instream-foreign-object>
>             <svg xmlns="http://www.w3.org/2000/svg" ...
> 
> I've done a test with a much smaller SVG graphic and an external link 
> (below) and this seems to work okay.  Although when clicking it still 
> looks like only the bottom half of the graphic is actually highlighted.
> 
> <fo:basic-link show-destination="new" role="An Example" 
> external-destination="http://www.yahoo.com">
>     <fo:inline>
>         <fo:instream-foreign-object><svg:svg width="3mm" height="3mm" 
> viewBox="0 0 30 30">
>             <svg:circle cx="15" cy="15" r="7" fill="#0000ff" 
> stroke="none" stroke-width="0"/></svg:svg>
>         </fo:instream-foreign-object>
>     </fo:inline>
> </fo:basic-link>
> 
> Has anyone else had similar problems with basic-links surrounding SVG 
> graphics?
> 
> Thanks,
> Jason
> 
> PS.  Using latest version of FOP from svn head


Jeremias Maerki


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