generate incomplete pdf before multiple iframe is loaded
See original GitHub issueSteps to reproduce
Tell us about your environment:
- Puppeteer version: 1.11.0 (I pasted the code from 1.9.0)
- Platform / OS version: MAC
- URLs (if applicable):
- Node.js version: v10.14.1
What steps will reproduce the problem? https://try-puppeteer.appspot.com/
const browser = await puppeteer.launch();
const page = await browser.newPage();
const html = '<iframe src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d12077.188806999058!2d-73.2243774!3d40.8214352!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0%3A0x9e562057f79c0860!2sH+Lee+Dennison+Building!5e0!3m2!1sen!2sus!4v1547750310674" height="250" width="600" allowfullscreen=""></iframe><div><iframe src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d12077.188806999058!2d-73.2243774!3d40.8214352!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0%3A0x9e562057f79c0860!2sH+Lee+Dennison+Building!5e0!3m2!1sen!2sus!4v1547750310674" height="250" width="600" allowfullscreen=""></iframe></div><div><iframe src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d12077.188806999058!2d-73.2243774!3d40.8214352!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0%3A0x9e562057f79c0860!2sH+Lee+Dennison+Building!5e0!3m2!1sen!2sus!4v1547750310674" height="250" width="600" allowfullscreen=""></iframe></div><div><iframe src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d12077.188806999058!2d-73.2243774!3d40.8214352!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0%3A0x9e562057f79c0860!2sH+Lee+Dennison+Building!5e0!3m2!1sen!2sus!4v1547750310674" height="250" width="600" allowfullscreen=""></iframe></div>'
await page.setContent(html, { waitUntil: 'domcontentloaded' });
await page.emulateMedia('screen');
await page.setViewport({
width: 1280,
height: 750
});
await page.waitFor(100000);
const pdf = await page.pdf({
scale: 1,
printBackground: true,
margin: { bottom: 0 },
path: 'screenshot.pdf'
});
await browser.close();
Please include code that reproduces the issue.
- go to https://try-puppeteer.appspot.com/
- paste the codes I have listed above (3 google map iframe)
- the pdf generated does not have the third iframe rendered correctly.
I have tried to set a timeout, even with 60 secs time out It wont render correctly. And it does not seem to respect the the rule of
await page.setContent(html, { waitUntil: 'domcontentloaded' });
What is the expected result? await page.setContent(html, { waitUntil: ‘domcontentloaded’ }); should get all iframe load events as well. or a method to provide a way of detecting iframe loading What happens instead? renders incomplete iframes.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
generate incomplete pdf before multiple iframe is loaded #4050
Steps to reproduce Tell us about your environment: Puppeteer version: 1.11.0 (I pasted the code from 1.9.0) Platform / OS version: MAC URLs ......
Read more >HTML embedded PDF iframe - Stack Overflow
The iFrame solution here is just what I needed to display a PDF generated by an MS MVC backend service and returned as...
Read more >Play safely in sandboxed IFrames - web.dev
Given an iframe with an empty sandbox attribute, the framed document will be fully sandboxed, subjecting it to the following restrictions:.
Read more >Getting the Form Iframe Code - Jotform
I get this message when i try to embed IFRAME code on sharepoint? "We can't show this embedded content because the code seems...
Read more ><iframe>: The Inline Frame element - HTML - MDN Web Docs
The HTML element represents a nested browsing context, embedding another HTML page into the current one.
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
thanks @vsemozhetbyt’s help. Here is the working codes:
What if you call
scrollIntoView()
for each frame in a loop waiting some time after each call and then create the PDF?