On 27/12/10 00:57, unkown UN wrote:
I have a design that is created in Inkscape, its a poster that has
visual, and informational elements to it. The information bits are subject to change. Is
there a way that I can get Inkscape to pull the data from a datasource [i.e. XML]?
Is a tr [preprocessing] the only way to go with this?
The task I am attempting to accomplish is to create a shell script that'll accept a
specific dataset to pass onto the template, use inkscape to transform the inkscape
resulting file into a PDF. etc
-Steven
Hi Steven:
As far as I know, Inkscape has no mechanism to pull data from other
sources, but there are a few ideas I have:
*) You could write a custom extension that fills in the data for you.
That would allow you to pull the data from pretty much any source and
use any format it might be provided in. You could also post-process the
file with the information filled in all without leaving Inkscape.
*) You could integrate your design into an XSLT stylesheet and combine
it with your data through a transformation. However, this way seems
quite cumbersome in your case and it would make it hard to edit the design.
*) You could use an external script to fill in the data. To set the
font, size, colour and other text-properties you could put some
place-holder text in your design. Assigning special XML-attributes to
the text (using the Inscape XML-editor) worked really well for me to
identify which portions needed to be replaced. This solution is really
very similar to option number one, but using an external script might be
more convenient, if you want to automate the whole process (e.g. calling
Inkscape afterwards in command-line mode to transform the SVG to PDF).
Hope this helps,
Hannes