Puppeteer PDF renders but missing content
See original GitHub issueSteps to reproduce
Install Puppeteer and render a PDF as a URL from Mac OS Mojave 10.14.5. When the PDF is rendered it is missing data from what the page looks like when rendered normally in a browser.
Tell us about your environment:
- Puppeteer version: 1.17.0
- Platform / OS version: 10.14.5
- Node.js version: 12.2.0 && 12.5.0
This problem does not exist when we test the same app on a Ubuntu 18.0.4 system.
What steps will reproduce the problem?
Install Puppeteer and create a PDF from an Node.js Express API endpoint.
Please include code that reproduces the issue.
await page.goto(url);
if (data.waitFor) {
try {
await page.waitFor(data.waitFor)
} catch(error) {
throw new Error(error);
}
}
const pdfBuffer = await page.pdf({
format: 'A4',
margin: {
top: '20px',
left: '20px',
right: '20px',
bottom: '20px',
}
});
await browser.close();
What is the expected result?
The PDF should render and have all the same data on the page that shows when rendered in a browser.
What happens instead?
The PDF is rendered but text is missing. Even text from the same table shows in some columns but not in others.
Issue Analytics
- State:
- Created 4 years ago
- Comments:12
Top Results From Across the Web
Puppeteer PDF renders but missing content · Issue #4647
Install Puppeteer and render a PDF as a URL from Mac OS Mojave 10.14.5. When the PDF is rendered it is missing data...
Read more >Puppeteer not rendering content on PDF (invisible text)
So, the hypothesis is that, sometimes the web font loads in time, and sometimes it does not. When it does not, the invisible...
Read more >Puppeteer | Puppeteer
Generate screenshots and PDFs of pages. Crawl a SPA (Single-Page Application) and generate pre-rendered content (i.e. "SSR" (Server-Side Rendering)).
Read more >Programmatically Rendering PDFs from HTML using Chrome ...
The latest solution I've found is Puppeteer. It's a Node.Js package that manipulates a headless (i.e. no browser window) version of Chrome. Chrome...
Read more >Convert web pages into PDFs with Puppeteer and NodeJS
Generating pre-rendered content for Single Page Applications (SPAs) ... but if you are in no rush to generate the PDF, you can always...
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
@wuno How you solve this problem? Thanks.
I have separate files for the template and the styles.
everything works perfect until I needed to set the font and it wouldn’t take it using
page.addStyleTag