CairoSVG

Convert your SVG files to PDF and PNG.

About CairoSVG

CairoSVG is:

Let's go!

Install

CairoSVG is available on PyPI, you can install it with pip:

$ pip3 install cairosvg

You can have more information and help in the "Installation" part of the documentation .

Convert

You can use CairoSVG as a standalone command-line program:

$ cairosvg image.svg -o image.png

Embed

You can also use CairoSVG as a Python 3 library:

$ python3
>>> import cairosvg
>>> cairosvg.svg2pdf(url='image.svg', write_to='image.pdf')

Want more?

Please read the documentation to learn more about how to use CairoSVG.

What's new?

Latest version of CairoSVG is 2.7.1, released on August 5, 2023 (changelog).

Version 2.5.2

CairoSVG 2.5.2 has been released!