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

Support PNG output #74

Open
knuesel opened this issue Apr 23, 2021 · 1 comment
Open

Support PNG output #74

knuesel opened this issue Apr 23, 2021 · 1 comment

Comments

@knuesel
Copy link

knuesel commented Apr 23, 2021

It would be useful to add support for PNG output.

While inferior to SVG in rendering quality, I think it has many use cases. Here's mine:

I want to distribute Jupyter notebooks that include the pictures generated by TikzPictures.jl . Currently the pictures are stored in the notebook as SVG. When the notebook is opened by a new user, the SVG is not trusted so the picture is not shown. The user has to rexecute the cell or explicitely trust the notebook to see the picture. See here and here for reports of this difficulty.

@mykelk
Copy link
Member

mykelk commented Apr 23, 2021

I think we can do this using the Poppler backend using something like:

Poppler_jll.pdftocairo() do exe
   return success(`$exe -png $(temp_filename).pdf $(temp_filename).svg`)
end

similar to what is found in src/svg.jl. We'd want to set some kind of global variable that sets the default backend for rendering. PRs are welcome.

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

No branches or pull requests

2 participants