No SVG rendering in PDF
See original GitHub issueSteps to reproduce
Tell us about your environment:
- Puppeteer version: 1.1.0
- Platform / OS version: Mac OSX
- URLs (if applicable): N/A
- Node.js version: v10.0.0
What steps will reproduce the problem?
- Generate html with local jpg and svg images (not inline)
- View in chrome: everything ok
- html > pdf with puppeteer
Puppeteer pdf config:
{
title: meta.title,
printBackground: true,
format: 'A4 landscape'
}
What is the expected result?
Expected result is a pdf with rendered SVG images. This happens when I manually save as PDF in chrome.
What happens instead?
SVG images are not rendered. Jpgs work fine though, so it doesn’t appear to be a path issue.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:11
- Comments:14 (1 by maintainers)
Top Results From Across the Web
Solved: SVG images not showing in PDF File
Solved: Hi everyone: I'm creating dynamic bar charts as SVG images. So far, no problems in just showing them in the app. But...
Read more >Svg Image is not properly render in the pdf - Stack Overflow
Here is my code to add svg image in the pdf using itext 7.1.3 and also using SVGConventer.The image not properly rendered, i...
Read more >Embedded SVG images are not included in generated PDF
Embedded SVG images are not included in generated PDF ... I attach an svg image (e.g. "test.svg") to a page; When editing the...
Read more >Render SVG images using vector primitives in PDF format
Render SVG images using vector primitives in PDF format. This will allow the SVG images to retain high quality at all zoom levels....
Read more >rsvg: Render SVG Images into PDF, PNG, (Encapsulated ...
Title Render SVG Images into PDF, PNG, (Encapsulated) PostScript, or. Bitmap Arrays. Version 2.4.0. Description Renders vector-based svg images into ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had to replace hex fill colors with named ones in order for SVGs to be rendered in PDFs.
Example with Github logo:
SVG not visible in PDF:
SVG visible:
In more complex SVGs I had to remove masks, too.
We are closing this issue. If the issue still persists in the latest version of Puppeteer, please reopen the issue and update the description. We will try our best to accomodate it!