sphinxcontrib-svg2pdfconverter
Sphinx SVG to PDF or PNG converter extension
What it is and what it does
This is a Sphinx extension that solves the problem of SVG image support in documentation builders that don't handle SVG natively—most commonly LaTeX, which is used to generate PDF documentation. When you include SVG images in a Sphinx project targeting a non-SVG-aware builder, this extension automatically converts them to PDF or PNG at build time, ensuring your documentation renders correctly.
The extension offers three pluggable backends for the actual conversion: Inkscape (full-featured but heavier), libRSVG's rsvg-convert (lighter weight), or CairoSVG (the lightest Python-based option). You choose which one to use by selecting the corresponding extension name in your Sphinx conf.py, and the tool must be installed separately on your system. Configuration is minimal—mostly just ensuring the converter binary is in your PATH, with optional tweaks to command-line arguments.
Use it for:
- Generate PDF documentation from Sphinx projects that use SVG diagrams or vector graphics.
- Convert SVG images to PNG for LaTeX-based PDF builds when SVG support is unavailable.
- Automatically handle SVG-to-raster conversion during CI/CD documentation builds without manual pre-processing.
- Use lightweight CairoSVG backend in containerized or resource-constrained build environments.
- Maintain source SVG files in documentation while supporting multiple output formats (PDF, HTML, etc.).
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Converts SVG images to PDF or PNG for Sphinx documentation builders that don't natively support SVG, using Inkscape, libRSVG, or CairoSVG as the underlying converter.
Yes. This is a stable, actively maintained extension with low install friction and no known vulnerabilities. Install it if you use Sphinx with SVG images and target builders like LaTeX that don't natively support SVG. The main prerequisite—having one of three external converters available—is a reasonable trade-off for automatic image conversion. Choose the backend that fits your environment (Inkscape for full features, rsvg-convert for balance, CairoSVG for minimal dependencies).
Install
sphinxcontrib-svg2pdfconverter on PyPI
pip
pip install sphinxcontrib-svg2pdfconverteruv
uv add sphinxcontrib-svg2pdfconverterpoetry
poetry add sphinxcontrib-svg2pdfconverterInstalling sphinxcontrib-svg2pdfconverter
Before you install
Low install friction with a single runtime dependency on Sphinx. Actively maintained as of 2026-03-05 with a stable production status. Requires one of three external system tools (Inkscape, rsvg-convert, or CairoSVG) to function; CairoSVG variant may need additional build dependencies depending on your OS.
License in practice
Licensed under BSD-2-Clause (permissive), allowing use in both open-source and proprietary projects with minimal restrictions.
Quickstart
pip install sphinxcontrib-svg2pdfconverter
# In conf.py, add one of:
extensions = ['sphinxcontrib.inkscapeconverter']
# or
extensions = ['sphinxcontrib.rsvgconverter']
# or
extensions = ['sphinxcontrib.cairosvgconverter']
Requires one of Inkscape, rsvg-convert (from libRSVG), or CairoSVG installed and available in your system PATH; CairoSVG may require additional OS-level build tools during installation.
Verify before relying
- Whether all three converter backends (Inkscape, libRSVG, CairoSVG) are equally well-tested and maintained.
- Performance characteristics and output quality differences between the three converter options.
- Compatibility with recent Sphinx versions beyond the stated Python 3.6+ support.
Package facts
| License | BSD-2-Clause (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — Sphinx |
| Maintenance | actively maintained — 162 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 377,822/month — #7,120 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: sphinxcontrib_svg2pdfconverter-2.1.0-py3-none-any.whl
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
CairoSVGCairoSVG converts SVG files to PDF, EPS, PS,…
copyleft · top 5,000 on PyPI
sphinx-simplepdfSphinx-SimplePDF is a Sphinx extension that…
permissive · top 15,000 on PyPI
typstCompiles Typst markup documents to PDF, PNG,…
unclear · top 15,000 on PyPI
sphinxcontrib-drawioA Sphinx extension that embeds draw.io diagrams…
permissive · top 15,000 on PyPI
sphinx-jupyterbook-latexA Sphinx extension that adds LaTeX output…
permissive · top 15,000 on PyPI
sphinxcontrib-plantumlAdds PlantUML diagram rendering to Sphinx…
permissive · top 15,000 on PyPI
svgwriteCreates SVG drawings programmatically by…
permissive · top 5,000 on PyPI
svgutilssvgutils lets you programmatically edit, scale,…
permissive · top 15,000 on PyPI
svglibSvglib reads SVG files and converts them to…
copyleft · top 5,000 on PyPI
ezdxfezdxf creates, reads, modifies, and writes DXF…
permissive · top 5,000 on PyPI