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
page break is not working!!! await page.emulateMediaType('screen') #5277
Comments
Seems like puppeteer has some issues with @media print.. I just tried updating my CSS to..
|
As for me, the problem was, that the .page was a flexbox. Check it out. |
Ahhhh. so flexbox and page-break-after aren't compatible? Will have to test it. Ultimately, I developed a work around that did not include Puppeteer. I just formatted my page components to be the size of the browser and then allow the user to print manually from chrome. Not as sexy as sending a scraped Puppeteer PDF being passed via Sendgrid... but got the job done! |
You should remove flexbox style in parent element not the element itself.
|
@SeungjongHan Thanks for the tip, it worked great! |
We're marking this issue as unconfirmed because it has not had recent activity and we weren't able to confirm it yet. It will be closed if no further activity occurs within the next 30 days. |
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! |
I am attempting to create a PDF of my screen using
Locally.. my PDF is returned to my browser with the proper sizing and formatting.. however. when running in production.. my formatting / margins are off..
This creates awkward page breaks in the middle of my content and is not suitable for my client!
I am using
"puppeteer": "^2.00.0"
and node version8.16.2
I am using heroku as my server.
Thanks in advance for your help!!!
The text was updated successfully, but these errors were encountered: