On Wed, 23 Mar 2011 09:47:48 -0700 (PDT) unkown UN <crashoverride025@...12...> wrote:
Has anyone been successful with creating templates with inkscape in which you can automate the generation of PDFs?
For example:
I have:
- Datasource [XML] that contains a list of data items
- The Visual Representation (as an inkscape file)
- A script that would combine the two and produce a pdf based on the datasource specifications
I know I asked a similar question to this before, but I was wondering if anyone had success at automating this task.
I've done it quite a bit. Depends what elements of the svg you're trying to manipulate.
Text is easy, I've done that with simple sed driven text replacement of [SITE_NAME] place holders.
Images you can do without editing the SVG by changing the content of the linked file (or symbolic link).
But for more complex things I've used Python's lxml library and Inkscape's XML editing to set the id attributes of the parts of the template I want to adjust, so I can find them easily with xpath in python.
Most recently as well as text and image substitutions I adjusted the length of a scale bar rectangle in the svg.
I just use os.system() to run inkscape to do the export.
But if you're looking for a pre-built tool which parses a list of inputs and feeds them through the template, I'm not aware of anything like that.
Cheers -Terry
-Steven
Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user