Skip to main content

Sphinx SVG to PDF converter extension

Project description

This extension converts SVG images to PDF 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. 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-1.3.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

File details

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

File metadata

File hashes

Hashes for sphinxcontrib_svg2pdfconverter-1.3.0.tar.gz
Algorithm Hash digest
SHA256 6411a4cc2f57eed96a0d7bbfa139f68cbe7983018881e1e6d7c46053cd69911f
MD5 78da22aca351032a3866436892d97568
BLAKE2b-256 e9e2ff9a504da29525e1443004751bdf8e2d23aef8e47a88135aa7a9a026d94a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sphinxcontrib_svg2pdfconverter-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5df6b0895e2e2101d720bfd08841bb56d74c57b1f86229a7c18b771dfdf4ffbb
MD5 6d4a50a11f3b1f1df40ad5f954f62707
BLAKE2b-256 d5397263bf392abd5b102171942337249fb7019332767aa06a6eb88be0456b51

See more details on using hashes here.

Supported by

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