Currently I'm using rsvg to load the svg (from a string, not from a file) and drawing to cairo. Anyone know a better way? I use PIL elsewhere in my application, but I don't know of a way to do this with PIL.
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
How about imagemagic? - http://www.imagemagick.org/script/magick-vector-graphics.php It can read/write from/to stdin/stdout so You can integrate it with your app even if You don't want to use files
I have inkscape installed so I am just farming out the process to the inkscape command with inkscape -f file.svg -e file.png
Using this code:
I am on windows 7, and got the Windows 5 Error [Access Denied] (or something like that) until I switched to the inkscape directory
Here's what I currently have:
You can also use PhantomJS for this (see http://phantomjs.org/screen-capture.html)
From a shell:
Or from python using selenium: