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 Jared Davis <su...@davisprogramming.com> on 2013/06/24 21:09:42 UTC

xlink:href in pdf from svg source?

Hi,

I can not generate a pdf from svg that contains an external link on the
text.  Should it work? Where should I look?

The output pdf file contains the text but no link to google.

svg:

<?xml version="1.0" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" version="1.0" viewBox="0 0 612
792" height="792pt" width="612pt" ><g transform="translate(36,36)">

<a xlink:href="http://www.google.com">
<text x="0" y="0.0" >Test Text with Link</text>
</a></g></svg> 



Code:

        org.apache.fop.svg.PDFTranscoder t = new
org.apache.fop.svg.PDFTranscoder();
        t.addTranscodingHint(PDFTranscoder.KEY_AUTO_FONTS, Boolean.FALSE);

        TranscoderInput input = new TranscoderInput(new StringReader(svg));
        File out = File.createTempFile("svg", ".pdf", dir);
        OutputStream ostream = new FileOutputStream(out);
        TranscoderOutput output = new TranscoderOutput(ostream);
        t.transcode(input, output);
        ostream.close();




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