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

SVG images fail to export to PDF #14

Closed
dhimmel opened this issue Jul 11, 2017 · 10 comments
Closed

SVG images fail to export to PDF #14

dhimmel opened this issue Jul 11, 2017 · 10 comments

Comments

@dhimmel
Copy link
Member

dhimmel commented Jul 11, 2017

Refs jgm/pandoc#265

@slochower
Copy link
Collaborator

That thread seems to indicate a problem going through LaTeX, but I think the problem persists if we do Markdown → HTML5 → PDF as is currently implemented. Are you considering creating a local rasterized copy of the graphics to generate the PDF? Something like this may be helpful: https://gist.github.com/jeromerobert/3996eca3acd12e4c3d40

@dhimmel
Copy link
Member Author

dhimmel commented Jul 12, 2017

Markdown → HTML5 → PDF

Yes, I agree that the problem is occurring for this lineage.

Are you considering creating a local rasterized copy of the graphics to generate the PDF?

I think there should be a solution that doesn't require rasterizing vectors. For example, if an SVG is converted to PDF, then it should be able to be embedded in a PDF without sacrificing the vectors?

@slochower
Copy link
Collaborator

For example, if an SVG is converted to PDF, then it should be able to be embedded in a PDF without sacrificing the vectors?

I hope so. Can you make a PDF version of the SVG file we're using for the figure example, built from the same source as the SVG?

@vsmalladi
Copy link
Collaborator

Should there be a local directory for the figures in the repository?

@dhimmel
Copy link
Member Author

dhimmel commented Jul 13, 2017

@vsmalladi see discussion on #1: currently we're focusing on images via URL. In #1, @slochower has a working solution for images via paths, but we didn't see a pressing need that justified the complexity.

@vsmalladi
Copy link
Collaborator

@dhimmel thanks for the brining me up to speed.

@vsmalladi
Copy link
Collaborator

Accidentally
put this in the wrong place: index.pdf

I have been playing with the using wkhtmltopdf and converting the images to png to get them to render for the pdf, based on code in #40. I have attached an example of converting from markdown to html5.

vsmalladi added a commit to vsmalladi/manubot-rootstock that referenced this issue Jul 30, 2017
@agitter
Copy link
Member

agitter commented Jul 30, 2017

@vsmalladi The figures show up, so that's a big improvement. All text and figures are tiny when I view the pdf though. Do you see that as well?

@vsmalladi
Copy link
Collaborator

@agitter Ya I had the same issue. Wanted to see if anyone else saw the same thing. Not sure what is happening with the scaling. But it is looking better.

@dhimmel
Copy link
Member Author

dhimmel commented Dec 20, 2017

Export of SVG images to PDFs should now be working (since we switched to WeasyPrint in #78). Let us know if your experience is otherwise and we can reopen this issue or start a new issue.

@dhimmel dhimmel closed this as completed Dec 20, 2017
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

4 participants