Headless Print to PDF - entire image clipped when it overflows page
Reported by
asonc...@gmail.com,
Oct 16 2017
|
||||||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36 Steps to reproduce the problem: 1. Print HTML document from here: https://jsfiddle.net/ws5gn6vg/ Using the following headless options: { landscape: false, displayHeaderFooter: false, printBackground: true, scale: 1, paperHeight: 6, paperWidth: 4, marginTop: 0, marginLeft: 0, marginRight: 0, marginBottom: 0, pageRanges: '' } What is the expected behavior? Images which overflow the page size should be partially clipped - their parent container has "overflow: hidden;" rule defined. What went wrong? Some images are entirely clipped. This seems to happen if the absolute position is set using 'top' causing overflow, but appears to work correctly using 'bottom' with a negative value (see HTML document for styles). Did this work before? N/A Chrome version: 61.0.3163.100 Channel: stable OS Version: Ubuntu 16.04 LTS x64 Flash Version: Size units (px vs in) do not seem to make a difference.
,
Oct 16 2017
May be related to https://bugs.chromium.org/p/chromium/issues/detail?id=772685, but the issue occurs with any element, not just SVGs.
,
Oct 16 2017
JSFiddle link is wrong, please use HTML document attached above.
,
Oct 16 2017
Correct fiddle: https://jsfiddle.net/agywqwdv/
,
Oct 16 2017
,
Oct 17 2017
Able to reproduce this issue on reported chrome version stable 61.0.3163.100 and on the latest canary 64.0.3241.0 using Ubuntu 14.04 and Windows 10 with steps mentioned in Comment#0. Note: In Mac 10.12.6 issue is not seen. This issue is seen from M50[50.0.2634.0]. Hence treating it as non-regression and marking as untriaged.
,
Oct 17 2017
Note that the fiddle URL in the original post is incorrect. Please use https://jsfiddle.net/agywqwdv/ or the uploaded HTML file.
,
Oct 17 2017
,
Oct 29 2017
I added a simplified test case showing images being clipped entirely when they overflow pages. The second page overflows by 0.1in, and the image disappears (see clipped-image.pdf). If 'overflow: hidden;' rule is removed from the page, then a third page is created and the image is pushed onto it (see extra-page.pdf).
,
Oct 29 2017
Previous test case was printed using the following parameters:
{
landscape: true,
displayHeaderFooter: false,
printBackground: true,
scale: 1,
paperHeight: 6,
paperWidth: 4,
marginTop: 0,
marginLeft: 0,
marginRight: 0,
marginBottom: 0,
pageRanges: ''
}
,
Dec 12 2017
Any progress? I've run into this with printing reports, though I was able to work around the image problem -- it's block of text that I don't have a work around for. Should the text handling be a separate issue?
,
Mar 6 2018
Any update on this?
,
Mar 7 2018
Sounds like a bug in printing, skia or blink. +thestig for routing.
,
Mar 7 2018
+chrishtr to check if this should be treated as dupe of bug 772685 , see comment #2.
,
Mar 7 2018
I also posted a similar bug. This one impacts any element which overlaps the wrapping page. Please see: https://bugs.chromium.org/p/chromium/issues/detail?id=819735
,
Mar 7 2018
I don't think it is the same as 772685, however not 100% sure. How do I print with headless to test locally?
,
Mar 7 2018
,
Mar 7 2018
,
Mar 7 2018
,
Mar 7 2018
Hi Chris, I am using node.js with 'Remote Chrome Interface' adapter (https://github.com/cyrus-and/chrome-remote-interface). You can also use Puppeteer to achieve the same (https://github.com/GoogleChrome/puppeteer). Would it help if I setup an executable nodejs repo?
,
Mar 7 2018
I've setup a repo for testing Headless issues - Linux + Docker + nodejs. This might save you some time: https://github.com/soncodi/chromium-headless-printtopdf Please let me know how I can help!
,
Mar 8 2018
Added a test for reproduction in https://crrev.com/c/955222. To run, build the headless_browsertests target and then: # ./headless_browsertests --gtest_filter=*PDFOverflow* You can trace this test using --trace-startup (to ensure the test runs long enough, simply remove the call to FinishAsynchronousTest(), which will make it time out).
,
Mar 8 2018
As ET team do not have headless setup on Linux to test and confirm this issue as of now.. Requesting for further help in triaging this. Thanks!
,
Mar 8 2018
The Rendering Core team can look after the bisect and/or testing.
,
Mar 12 2018
Tried to setup Headless on Linux by following the steps mentioned in https://github.com/soncodi/chromium-headless-printtopdf After running this command: docker build -t headless, it asked to get docker. We used "sudo apt-get install docker" command to get it. Even after that it says docker isn't available. Attaching the screen cast of the same. Could someone help us whether the steps followed to setup Headless are correct! Thanks!
,
Mar 12 2018
Hello, If you have Chrome or Chromium browsers installed, it may be easier to skip Docker altogether. I've just updated the repository with additional run scripts and instructions: https://github.com/soncodi/chromium-headless-printtopdf To run Chrome inside Docker instead, the best option is to follow the official guide for Docker CE (https://docs.docker.com/install/linux/docker-ce/ubuntu/) instead of installing from Ubuntu repos. Note that Docker requires superuser permissions, so you will need to prefix the run script with sudo. Alternately you can run: sudo usermod -aG docker $USER and logout/login to run Docker as your current user without sudo.
,
Mar 12 2018
Issue still appears in nightly Chromium 67.0.3369.0 (64-bit)
,
Mar 13 2018
Is this the same as 494316 ?
,
Mar 13 2018
I'd be willing to bet it is indeed the same as 494316. Good call. That one should be easier to debug. Not marking duplicate yet because we're not sure.
,
Mar 16 2018
Checked the issue on latest stable 65.0.3325.162 and on 60.0.3072.0 using Ubuntu 14.04 with the below mentioned steps. 1. Downloaded the file provided in https://github.com/soncodi/chromium-headless-printtopdf 2. Unzipped the file to Documents folder 3. Opened terminal and, have run the command git clone https://github.com/soncodi/chromium-headless-printtopdf.git 4. Changed the directory to Documents 5. Then Cd chromium-headless-printtopdf-master 6. npm install 7. ./run-chrome.sh Observed similar results in folder "Fixture" in both the above mentioned chrome versions. Attaching the screen shots of the same. Thanks!
,
Mar 16 2018
,
Mar 16 2018
The repro shown in the screens above is actually for another print bug I filed: https://bugs.chromium.org/p/chromium/issues/detail?id=819735 It is a very similar issue which may turn out to be a duplicate. Note that both issues can be reproduced using the github repo provided (after changing the input file).
,
Mar 19 2018
The NextAction date has arrived: 2018-03-19
,
Mar 27 2018
Hello, any further update? Did the repository help - should I provide additional repros?
,
Mar 27 2018
I have a fix but it requires testing and more important things have come up. I'll make every effort to get it into M-66.
,
Mar 27 2018
,
Apr 9 2018
Understood, and thank you for your help here. This issue hits our central path so anything I can do to help please let me know! If it does not make it into M66 - would it be possible to get a dev build with the patch? Thanks again.
,
Apr 30 2018
Hi, any chance to get a dev/nightly build with this for testing?
,
May 1 2018
Sorry, still working through other regressions. I can't say when I'll get back to this, but it will be soon.
,
May 30 2018
This issue and related https://bugs.chromium.org/p/chromium/issues/detail?id=819735 are impacting a large percentage of our users in production. This is of critical priority to us. We can help with testing and infrastructure setup. Please let us know what can be done to fast-track this.
,
Jun 28 2018
Hello, any update on this?
,
Jun 29 2018
Best estimate right now is a fix for Chrome 69.
,
Jul 18
,
Jul 20
phanindra.mandapaka@chromium.org -- issue 852652 merged into this one seems unrelated. Can you also take a look at this one: https://bugs.chromium.org/p/chromium/issues/detail?id=819735
,
Sep 12
@schenney which fixes did you think would help to resolve this bug?
,
Sep 13
I had an attempted fix but it broke some other test case that mstensho@ pointed out broke other content. https://chromium-review.googlesource.com/c/chromium/src/+/1176268 The real fix is to add struts for block level content, but that's bigger. I should un-assign myself unless we consider the other breakage less bad than this breakage, or I limit the proposed fix more tightly. |
||||||||||||||
►
Sign in to add a comment |
||||||||||||||
Comment 1 by asonc...@gmail.com
, Oct 16 20173.1 KB
3.1 KB View Download