Search code examples
windowspython-sphinxplantumlrst2pdf

How to configure epstopdf for the Sphinx plantuml extension?


I'm trying to get Sphinx on Windows to generate a PDF with the rst2pdf plugin. My reStructuredText files make use of the PlantUML Sphinx extension.

When generating a PDF, I get the message

SphinxWarning: WARNING: epstopdf command 'epstopdf' cannot be run

How do I get this working?


Solution

  • epstopdf is a Perl application, which can be downloaded from CTAN. Install Strawberry Perl, and execute epstopdf.pl to test it:

    D:\epstopdf>perl epstopdf.pl
    Error: Input filename missing (try --help for more information)
    

    Add the following to conf.py:

    plantuml_epstopdf = 'perl "D:\epstopdf\epstopdf.pl"'
    

    Install Ghostscript, and add it to the path:

    set PATH=%PATH%;"C:\Program Files (x86)\gs\gs9.20\bin"
    

    Now you should be able to generate PDF's.