skillfed

sphinxcontrib-svg2pdfconverter

Sphinx SVG to PDF or PNG converter extension

sphinxcontrib-svg2pdfconverter v2.1.0 377.8K downloads/30d#7,120 on PyPI30
Permissive license BSD-2-Clause Active released

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-svg2pdfconverter

uv

uv add sphinxcontrib-svg2pdfconverter

poetry

poetry add sphinxcontrib-svg2pdfconverter

Installing 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

Development Status :: 5 - Production/StableEnvironment :: ConsoleEnvironment :: Web EnvironmentFramework :: Sphinx :: ExtensionIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: Python :: 3Topic :: DocumentationTopic :: Utilities

Tags

sphinx svg to pdf converterconvert svg images latex documentationsphinx svg png extensionsvg to pdf sphinx plugininkscape rsvg cairosvg sphinx
sphinx-extensionsvg-conversiondocumentation-build

More Utilities packages