--- id: cairosvg version: "2.9.0" license: LGPL-3.0-or-later license_treatment: copyleft maintenance: active --- # CairoSVG — A Simple SVG Converter based on Cairo License: copyleft · Maintenance: active · Downloads: 20.7M/mo ## What it is and what it does CairoSVG is a Python library that renders SVG files to multiple output formats—PDF, EPS, PostScript, and PNG—by delegating rendering to the Cairo graphics engine. It wraps Cairo functionality through cairocffi and uses cssselect2 and tinycss2 to parse SVG stylesheets and selectors, defusedxml to safely parse XML, and Pillow for raster image handling. The library is stable (Production/Stable status), actively maintained, and supports modern Python versions from 3.10 onward. Typical use cases include batch conversion of vector graphics for print or web distribution, programmatic SVG-to-PDF generation in document pipelines, and rendering SVG content to raster formats when vector output is not required. The copyleft LGPL license means you must disclose modifications if you redistribute the library, but using it as a dependency in your own application is straightforward. Use it for: - Convert SVG graphics to PDF for embedding in reports or print-ready documents. - Batch export SVG icons or illustrations to PNG for web use or mobile apps. - Generate PostScript or EPS output from SVG for legacy printing systems or archival. - Programmatically render SVG content in a document generation pipeline without manual design tool steps. - Transform vector graphics to raster formats when downstream tools require PNG or similar formats. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. CairoSVG converts SVG files to PDF, EPS, PS, and PNG formats using the Cairo graphics library. Yes. CairoSVG is production-stable, actively maintained, has low install friction, no known vulnerabilities, and solves a concrete problem (SVG conversion to multiple formats). The LGPL copyleft license is standard for graphics libraries and poses no barrier for most use cases. Install if you need reliable SVG-to-PDF/PNG/EPS conversion. ## Install pip install cairosvg uv add cairosvg poetry add cairosvg ## Installing CairoSVG Before you install: Low install friction with a pure Python wheel distribution. Active maintenance with a recent release (154 days ago) and ongoing repository activity; supports current Python versions (3.10–3.14). License in practice: LGPL-3.0-or-later copyleft license requires that derivative works and modifications remain under the same license; acceptable for most projects but review your distribution model if you plan to bundle or modify the source. Quickstart: pip install cairosvg import cairosvg carosvg.svg2pdf(url='input.svg', write_to='output.pdf') Requires Python 3.10 or later; Cairo graphics library must be available on the system (typically pre-installed on most Linux distributions, may require separate installation on macOS or Windows). Verify before relying: - Whether Cairo system library is pre-installed or requires manual setup on Windows and macOS platforms. - Performance characteristics when converting large or complex SVG files in batch operations. ## Package facts - License: LGPL-3.0-or-later (copyleft) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 20.7M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags svg to pdf converter, svg to png export, cairo svg conversion, batch svg conversion, svg graphics rendering, svg postscript export, vector to raster conversion, svg-conversion, document-generation, graphics-rendering [View on SkillFed](https://skillfed.io/packages/cairosvg) · [View on PyPI](https://pypi.org/project/cairosvg/)