I’m using Pisa/XHTML2PDF to generate PDFs on the fly in Django. Unfortunately, I need to include SVG images as well, which I don’t believe is an easy task.
What’s the best way to go about either a) converting the SVGs to PNG / JPG (in Python) or b) including SVGs in the PDF export from Pisa?
There’s the Java based Apache Batik SVG toolkit.
In a similar question regarding C# it was proposed using the command line version of Inkscape for this.
For Python, here’s a useful suggestion from this discussion thread:
the step
from gtk import gdk, suggested by Lukasz, is necessary and has to precede creation of the pixbuf, otherwise you will not get thesavemethod, as observed by the original poster.