I'm using flowcharts (SVG files) in my documentation, and would like to be able to include cross-references (perhaps also variables and conditional text) in these graphics.
I am using Flare 12 R2 and have Ghostscript and the correct Java version installed so that linked SVGs with static text (eg. <img src="myflowchart.svg"/>) are working fine when added to PDF targets (as well as HTML5). However these linked SVGs do not display in HTML5 or in PDF when there is dynamic text involved, such as a cross-reference.
I would therefore like to use SVG as an inline element so that the text is processed by Flare. For example,
Code: Select all
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="100" height="100">
<circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="red" />
<text x="0" y="15" fill="blue">This is some SVG text!</text>
<text x="0" y="55" fill="blue">See <MadCap:xref xlink:href="DummyTopic.htm">DummyTopic</MadCap:xref>.</text>
</svg>
So, does anybody have an idea how I can find a solution that displays SVGs with Flare-processed text in PDFs?
I'm happy to invest some development time in finding/building a solution. Some ideas I've been thinking about are:
- Making a pre-build script that builds a minimal HTML5 target with the flowcharts, saves the resulting SVGs to a directory, and the PDF target uses linked SVG files from this directory. Manually trying this shows the image but with no hyperlink.
- Building the PDF target twice - writing some script that resolves the text on the first build, uses a post-build script to replace some placeholder text in a SVG with this content and build again for the updated version. This seems difficult as it would be hard to reach into the PDF output to access the resolved text, and I'm not sure if these links will work in the output.
- Using EPS or some other vector-graphics format in the PDF, though I don't think Flare can resolve xrefs in EPS either (from testing).