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.2.3.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

File details

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

File metadata

File hashes

Hashes for sphinxcontrib_svg2pdfconverter-1.2.3.tar.gz
Algorithm Hash digest
SHA256 fb5d517b634c5629522004c59edce4d9050d89822408cab452c7d52fe5ae9824
MD5 a47eca1420aa3a7796fa1d6da599cbc0
BLAKE2b-256 55df038c33dd93daea6ca91f8168a5bbcab7744f030005a15e23d6a50793a264

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sphinxcontrib_svg2pdfconverter-1.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f757330fc0f89c2e4768d85e385b6dd6edc67f7ccb09b3dc6939cbcaf57a88ea
MD5 8ea94e70308680752a36c5b24860ea9b
BLAKE2b-256 f1858563d13887eb4181ff8cab9c97dc841bf3752a0df63c8d5fd2e890d2e7e7

See more details on using hashes here.

Supported by

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