Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow rsvg-convert as fallback to inkscape when converting SVGs to PDF #885

Open
kylebarron opened this issue Sep 11, 2018 · 3 comments
Open

Comments

@kylebarron
Copy link

A server I use doesn't have inkscape installed, but does have rsvg-convert, which is based on librsvg.

Are any of the following possible?

  1. Modify svg2pdf.py to see if rsvg-convert exists if inkscape doesn't
  2. I have a simple Pandoc filter to convert SVGs to PDFs (trying both inkscape and rsvg-convert). I assume nbconvert uses Pandoc to convert from Markdown to TeX. Is it possible 1) to insert a filter at all and 2) to do this before svg2pdf.py gets run?
@t-makaro
Copy link
Contributor

You should be able to modify SVG2PDFPreprocessor.command to call any command that you want using a config file or from the command line. If the command does not use inkscape, then nbconvert will not use inkscape. So long as the command takes 2 arguments. One for the input filename and one for the output filename.

See docs.

For reference the default command is:

self.inkscape + ' --without-gui --export-pdf="{to_filename}" "{from_filename}"'

@benz0li
Copy link

benz0li commented Jul 26, 2022

See JuliaLang/IJulia.jl#1038 (comment) on how to configure IPython and IRkernel

to output both image/svg+xml and application/pdf plot formats in the notebook file:

  • image/svg+xml for plot display in the browser
    + HTML conversion using SVG instead of PNG
  • application/pdf for direct PDF conversion

ℹ️ With application/pdf plot format in the notebook file, inkscape is not required for PDF conversion using nbconvert.

See JuliaPlots/Plots.jl#4288 about a possible solution for IJulia when using Plots.jl.

@benz0li
Copy link

benz0li commented Aug 29, 2022

Inkscape has been removed from the minimal-notebook: jupyter/docker-stacks#1765

@kylebarron May you close this issue?

FYI @mathbunnyru

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants