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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sphinxcontrib_svg2pdfconverter-2.1.0.tar.gz.
File metadata
- Download URL: sphinxcontrib_svg2pdfconverter-2.1.0.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9756e82d5f3bf11629ffcbafb1f8a1092d3bb4789e33494032cdce9a9c8459d3
|
|
| MD5 |
24f17b4e328b792d24d0be6b9e5617e6
|
|
| BLAKE2b-256 |
b90511b12853b6a0398bd19d5464b68cb97dde21c354265ff2c1929f92ae03a9
|
File details
Details for the file sphinxcontrib_svg2pdfconverter-2.1.0-py3-none-any.whl.
File metadata
- Download URL: sphinxcontrib_svg2pdfconverter-2.1.0-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
805635ac274583e1606b0ec7fb21f16b69ca8ff223dd7e237d91127015628b0c
|
|
| MD5 |
2305f4fc618e3a791e523a8326cae8ea
|
|
| BLAKE2b-256 |
ce7d9b6b1ef6fe13bac6455d002ca4a626fac325cf94b4183f31cafe9b1ed17c
|