Getting Inkscape to work as a template editor
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
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
*) 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.
XML is a powerful, portable technology. I vote for this one.
*) 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).
On Dec 26, 2010, at 4:20 PM, Hannes Hochreiner wrote:
*) 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).
Actually I've found a combination of both of those to be a good approach.
Instead of using XSLT that is SVG or creates SVG, you can use XSLT's "document()" function to pull in an SVG file from outside of an XSLT stylesheet.
The XML file being processed can be a file of the data you want to merge, and you can use full XPath to transform the SVG in an XML-aware fashion.
participants (4)
-
Hannes Hochreiner
-
Jon Cruz
-
unkown UN
-
william.crocker@...2677...