-
Notifications
You must be signed in to change notification settings - Fork 9k
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
preferCSSPageSize option for PDF generation doesn't do anything #6657
Comments
The Chromium team has confirmed the change in behavior as of version 83, which is starting from Puppeteer 3.1.0. (Issue 1160301: Print preview/save to PDF produces 3 pages long document). The change was intended and the page breaks are expected. This was implemented according to Named pages with page-orientation. So the cause right now is clear. The question to the Puppeteer team is still open ... Why As the comment, I can see thousands of open issues that nobody replies to. Is anyone even monitors this queue? The project looks like moving on, but nobody looks like cares about ongoing issues. |
That's a shame. Because the print preview in chrome browser is now correct with e.g. |
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. |
Still an issue |
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. |
Still a problem |
The issue still exists, if a css specify a page size, puppeteer ignore format {"path":"test.pdf","margin":{"top":"1cm","bottom":"1cm","left":"1cm","right":"1cm"},"scale":1,"format":"A4","printBackground":true,"landscape":true,"preferCSSPageSize":false} |
We have upgraded the Chromium 80.0.3987.0 - Puppeteer v2.1.0 to the newest Chromium 88.0.4298.0 - Puppeteer 5.5.0 to pursue the taggable PDF output. After the upgrade the following HTML ...
when converted to PDF produces 3 pages, one with before content, the second with content, and the third with after content. With the previous Puppeteer 2.1 we had, the same HTML was producing the single PDF page, which we would expect if
preferCSSPageSize: false
, which is the default by the way. I assume the option tells the converter to ignore@Page
media.Are there any changes to this PDF option? Is my assumption wrong (but in this case what does this option do for the given HTML)?
We have tried to set explicitly
preferCSSPageSize
, but it doesn't make any difference, we are getting 3 pages PDF all the time.Please note: I am not asking how to modify HTML to get one page, I am completely aware of the page CSS property; I am asking what was changed over the versions, as well as clearly understand why
@Page
media suddenly start working when should be suppressed.The text was updated successfully, but these errors were encountered: