Skip to main content

Sphinx SVG to PDF or PNG converter extension

Project description

This extension converts SVG images to PDF or PNG in case the builder does not support SVG images natively (e.g. LaTeX).

Internally, either Inkscape, rsvg-convert from libRSVG or CairoSVG as progressively more lightweight alternatives are used to convert images.

Installation

Just install via pip:

$ pip install sphinxcontrib-svg2pdfconverter

You can choose between Inkscape, libRSVG and CairoSVG by adding sphinxcontrib.inkscapeconverter, sphinxcontrib.rsvgconverter or sphinxcontrib.cairosvgconverter to the extensions list in your conf.py.

Make sure to have either inkscape or the rsvg-convert command available in your systems PATH and, if necessary, adapt the inkscape_converter_bin or rsvg_converter_bin config value respectively.

CairoSVG requires additional dependencies to be installed with:

$ pip install sphinxcontrib-svg2pdfconverter[CairoSVG]

CairoSVG and its dependencies may require additional tools during the installation depending on the OS you are using; see the CairoSVG documentation for further details.

Configuration

Inkscape

inkscape_converter_bin

Path to Inkscape binary. By default, this is inkscape.

inkscape_converter_args

Additional command-line arguments for Inkscape, as a list. By default, this is ['--export-area-drawing'].

RSVG

rsvg_converter_bin

Path to RSVG converter binary. By default, this is rsvg-convert.

rsvg_converter_format

The value provided to the RSVG converter’s --format argument when converting to PDF. In more recent RSVG builds, the pdf1.5 format will generate the fewest warnings with LaTeX backends. By default, this is pdf.

rsvg_converter_args

Additional command-line arguments for the RSVG converter, as a list. By default, this is the empty list [].

CairoSVG

No configuration is required.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sphinxcontrib_svg2pdfconverter-2.1.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file sphinxcontrib_svg2pdfconverter-2.1.0.tar.gz.

File metadata

File hashes

Hashes for sphinxcontrib_svg2pdfconverter-2.1.0.tar.gz
Algorithm Hash digest
SHA256 9756e82d5f3bf11629ffcbafb1f8a1092d3bb4789e33494032cdce9a9c8459d3
MD5 24f17b4e328b792d24d0be6b9e5617e6
BLAKE2b-256 b90511b12853b6a0398bd19d5464b68cb97dde21c354265ff2c1929f92ae03a9

See more details on using hashes here.

File details

Details for the file sphinxcontrib_svg2pdfconverter-2.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinxcontrib_svg2pdfconverter-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 805635ac274583e1606b0ec7fb21f16b69ca8ff223dd7e237d91127015628b0c
MD5 2305f4fc618e3a791e523a8326cae8ea
BLAKE2b-256 ce7d9b6b1ef6fe13bac6455d002ca4a626fac325cf94b4183f31cafe9b1ed17c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page