xlink:href in pdf from svg source?
Jared Davis <[email protected]> Mon, 24 Jun 2013 19:09:42 +0000 (UTC)
| Newsgroups | gmane.text.xml.batik.user |
|---|---|
| Message-ID | <[email protected]> |
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();