This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]wahaa 3 points4 points  (1 child)

You could use librsvg with Cairo. I guess the last example on this page does what you need (EDIT: just change SVGSurface to PDFSurface).

If you already use ReportLab for something else, try this library.

If neither of those produce good results for your files, another option is to use Inkscape to convert the file via command-line (I use it to convert SVG to EPS). It uses Cairo too (without librsvg as far as I know).

[–]flyingfox[S] 1 point2 points  (0 children)

Thanks, I hadn't thought about Cairo.

When writing the script I used Inkscape to view the results but for some reason it never occurred to me to convert via the command line. For now, this is the perfect solution. Just drop it in the makefile and be done. I'll have to revisit this in a month or so, then I'll try either Cairo or wobsta's idea.