developer.bitcoin.org
developer.bitcoin.org copied to clipboard
Generating PDF: Sphinx can't handle SVG
I wanted to generate the documentation as a print-friendly PDF. I cloned the repo and ran make latexpdf
, but faced an error:
! LaTeX Error: Unknown graphics extension: .svg.
Turns out, Sphinx's PDF generation does not support SVG. I understand that this is the problem of Sphinx, not necessarily this repo. However, generating a PDF for printout may be helpful. Is there a way to enable this? For instance, provide copies of images in PNG? Or add instructions in the readme on how to convert SVG to PNG, or install some plugin for Sphinx that can solve the problem?
i found this in sphinx docs :
SVG to PNG (image rasterized) : https://www.sphinx-doc.org/en/master/usage/extensions/imgconverter.html?highlight=svg#module-sphinx.ext.imgconverter
SVG to PDF : https://github.com/missinglinkelectronics/sphinxcontrib-svg2pdfconverter
Hope that helps.