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.
Metadata
Release files for sphinxcontrib-svg2pdfconverter 2.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sphinxcontrib_svg2pdfconverter-2.1.0.tar.gz | 6.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sphinxcontrib_svg2pdfconverter-2.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.1 kB
Release files / sphinxcontrib_svg2pdfconverter-2.1.0.tar.gz
| Download URL | sphinxcontrib_svg2pdfconverter-2.1.0.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9756e82d5f3bf11629ffcbafb1f8a1092d3bb4789e33494032cdce9a9c8459d3
|
|
BLAKE2b-256 checksum How to use checksums |
b90511b12853b6a0398bd19d5464b68cb97dde21c354265ff2c1929f92ae03a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / sphinxcontrib_svg2pdfconverter-2.1.0-py3-none-any.whl
| Download URL | sphinxcontrib_svg2pdfconverter-2.1.0-py3-none-any.whl |
|---|---|
| Size | 9.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
805635ac274583e1606b0ec7fb21f16b69ca8ff223dd7e237d91127015628b0c
|
|
BLAKE2b-256 checksum How to use checksums |
ce7d9b6b1ef6fe13bac6455d002ca4a626fac325cf94b4183f31cafe9b1ed17c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|