Excessive PDF size when background-image doesn't fit print layout height
Reported by
alexey.v...@gmail.com,
Nov 30
|
||||||||
Issue description
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36
Steps to reproduce the problem:
1. Use HTML page which only contains <div> with background-image style: <div style=" background-image: url('https://...')">. Image height should be larger that output "paper size" height, and the image bottom should be cut off to fit in the output dimensions.
3. Save this HTML page as PDF
What is the expected behavior?
Output PDF size corresponds to initial JPG file size
What went wrong?
Output PDF size is nearly 10 times larger than initial JPG file size
Did this work before? N/A
Does this work in other browsers? Yes
Chrome version: 70.0.3538.110 Channel: stable
OS Version: OS X 10.14.1
Flash Version:
Reproduces for:
1. Chrome "Print" with destination "Save to PDF" on UI
2. Headless mode "convertToPdf" via Puppeteer.
Some testing cases:
350kb jpg as background-image is resulting to:
0.5Mb PDF when 1380x1953pixels initial jpg is saved to A4 layout
4.5Mb PDF when 1380x1995pixels initial jpg is saved to A4 layout (too big height to fit in to A4 layout dimensions)
4.3Mb PDF when 1311x1953pixels initial jpg is saved to US Letter layout (too big height to fit in to US Letter layout dimensions)
,
Nov 30
Sounds like bug 897732 .
,
Nov 30
,
Nov 30
,
Dec 3
Sorry for duplicating if it's the case. Have read everything at https://bugs.chromium.org/p/chromium/issues/detail?id=897732 , and it looks like using the suggested workaround with scaling the images before creating the PDF is not really acceptable approach, because we are not controlling the images while we run the Puppeteer. And the bug is still existing and actual.
,
Dec 4
As per comment #2, as this issue seems to be a duplicate of issue 897732 , requesting halcanary@ to look into the issue and provide an update. Thanks..
,
Dec 4
Thank you. I would like to add a significant concern: in case the user prints the page as PDF, we cannot know the correct image dimensions because the user can choose any layout (A4, letter).
,
Dec 7
Mac triage: thestig@, do you understand this issue report?
,
Jan 11
This issue has an owner, a component and a priority, but is still listed as untriaged or unconfirmed. By definition, this bug is triaged. Changing status to "assigned". Please reach out to me if you disagree with how I've done this.
,
Jan 16
(6 days ago)
original bug reporter: Can you provide some sample HTML, CSS, and/or images for this issue? re: comment 5 - Can you file a bug for your own issue instead of commenting on other people's issues?
,
Jan 17
(6 days ago)
Thank you for response. And sorry for the mess with comment 5: it's my comment from another account. The sample is attached, should be printed as A4 Portrait without margins in order to reproduce.
,
Jan 17
(6 days ago)
Thank you for providing more feedback. Adding the requester to the cc list. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot |
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by dtapu...@chromium.org
, Nov 30