- a SVG 1.1 to PNG, PDF, PS and SVG converter;
- a command-line interface;
- a Python 3.4+ library;
- known to work at least on Linux, OS X, and Windows;
- based on the Cairo 2D graphics library;
- tested using the W3C test suite;
- LGPLv3-licensed free software.
CairoSVG is available
on PyPI, you can
install it with pip:
$ pip install cairosvg
You can have more information and help in the
"Installation" part of the documentation
You can use CairoSVG as a standalone command-line program:
$ cairosvg image.svg -o image.png
You can also use CairoSVG as a Python 3 library:
>>> import cairosvg
>>> cairosvg.svg2pdf(url='image.svg', write_to='image.pdf')
Please read the documentation to learn more
about how to use CairoSVG.
Latest version of CairoSVG is 2.0.0rc4,
released on July 16, 2016
Last call before 2.0.0
CairoSVG 2.0.0rc4 has been released today and may be the last release canditate
before 2.0.0. It’s time to test and check that everything is OK for you, dear
users and developers of CairoSVG!
2.0.0 is a new major version, its changelog includes:
- Drop Python 2 support.
- Drop pycairo support.
- Rely on cairocffi, lxml, cssselect, pillow and tinycss.
- Fix markers.
- Fix URL/id handling.
- Use bounding boxes for gradients.
- Split deployment and development tests.
- Test with Travis.
I’d also like to thank the people who took some time to report issues, fix bugs
and add new features. Your tireless help is really appreciated!