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

Convert svg images to png for pdf documentation #3979

Closed
ale5000-git opened this issue Apr 20, 2018 · 10 comments
Closed

Convert svg images to png for pdf documentation #3979

ale5000-git opened this issue Apr 20, 2018 · 10 comments
Labels
Improvement Minor improvement to code

Comments

@ale5000-git
Copy link

ale5000-git commented Apr 20, 2018

Details

Expected Result

Hi,
I have some svg dynamically generated server-side by external services (badges).

Is it possible to automatically convert them to png in the pdf documentation?

Actual Result

Currently they doesn't appear at all in the pdf.

@stsewd
Copy link
Member

stsewd commented May 1, 2018

This is a sphinx issue sphinx-doc/sphinx#4720. There are some solutions there.

@ale5000-git
Copy link
Author

ale5000-git commented May 7, 2018

Hi,
I got a reply in the sphinx issue:

It seems readthedocs.org does not provide imagemagick. So sphinx.ext.imgconverter will not work.
I don't know how to enable it on readthedocs. Please ask to the administrator.

How can it be fixed?

@stsewd
Copy link
Member

stsewd commented May 7, 2018

I'm not sure how the imagemagick plugin works, I'll try to search about that later

@ale5000-git ale5000-git changed the title How make svg images static Convert svg images to png for pdf documentation May 7, 2018
@stsewd stsewd added the Support Support question label May 10, 2018
@stsewd stsewd added Improvement Minor improvement to code Needed: design decision A core team decision is required and removed Support Support question labels May 17, 2018
@stsewd
Copy link
Member

stsewd commented May 17, 2018

Ok, reading the docs http://www.sphinx-doc.org/en/master/ext/imgconverter.html RTD needs to install imagemagick in its docker images https://github.com/rtfd/readthedocs-docker-images.

This would be a feature request.

erwanp added a commit to radis/radis that referenced this issue Oct 13, 2018
…vg > pdf conversion (readthedocs/readthedocs.org#3979). Added path to svg image as alternative link instead
@mgeier
Copy link
Contributor

mgeier commented Oct 23, 2018

Alternatively, the extension sphinxcontrib-svg2pdfconverter could be used to convert SVG to PDF (which doesn't turn the images into bitmaps!). See #4797 (and #905).

@Moini
Copy link

Moini commented Oct 25, 2018

Tbh. I don't care very much about the 'how', but I would definitely like to see vector graphics used at readthedocs in exported pdfs. I'm trying to build an Inkscape Manual here....

@humitos
Copy link
Member

humitos commented Nov 14, 2018

Alternatively, the extension sphinxcontrib-svg2pdfconverter could be used to convert SVG to PDF (which doesn't turn the images into bitmaps!). See #4797 (and #905).

I suppose that this extension needs readthedocs/readthedocs-docker-images#79 (librsvg2-bin package), right?

By default, without any kind of extension, Sphinx will automatically use imagemagick, right?

If I'm right in both, I would say that we want to add imagemagick to the docker image also.

@humitos humitos removed the Needed: design decision A core team decision is required label Nov 14, 2018
@humitos humitos added this to the New build features milestone Nov 14, 2018
@humitos
Copy link
Member

humitos commented Nov 14, 2018

I read your suggestion from readthedocs/readthedocs-docker-images#70 (comment) and I think that I'm right and you have a point with that extension. Although, I think we should support both possibilities.

@mgeier
Copy link
Contributor

mgeier commented Nov 14, 2018

@humitos

Yes, it needs the librsvg2-bin package.

By default, without any kind of extension, Sphinx will automatically use imagemagick, right?

You still need to explicitly enable the built-in extension sphinx.ext.imgconverter.

Although, I think we should support both possibilities.

I agree, having both would be good.

Even though most of the times SVG -> PDF looks better, there are also cases where SVG -> PNG is preferable (e.g. when the SVG is overly complex).

@humitos
Copy link
Member

humitos commented Nov 15, 2018

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

No branches or pull requests

5 participants