printToPdf - headers and footers are always visible
Reported by
jo...@hazardscout.com,
Oct 27 2017
|
||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36 Steps to reproduce the problem: 1. google-chrome --headless --disable-gpu --no-sandbox --print-to-pdf https://www.google.com 2. 3. What is the expected behavior? Expected there to be no header or footer since the `--display-header-footer` flag was not included. What went wrong? The header (date) and footer (url, page number) are visible. (see attached) If I include the following CSS on the page, then the header/footer are removed, but the margins are messed up: <style>@page{margin:0;size: auto;}</style> Did this work before? N/A Chrome version: 63.0.3239.18 Channel: beta OS Version: Ubuntu 16.04 Flash Version: I'm not sure when it changed, but the headers/footers didn't used to show up.
,
Nov 1 2017
,
Nov 2 2017
Hello again. I'm not sure where you got your information, but there is no "--display-header-footer" flag in Chromium.
,
Nov 2 2017
The --print-to-pdf command added basic printing support first and then footer and header support. Maybe you were using an unfinished version of print to pdf. Now if you want to turn off footer and header, you may try https://github.com/GoogleChrome/puppeteer, since there is no flag in Chromium to turn them off.
,
Nov 2 2017
We started using --print-to-pdf in Chrome 59, so maybe that explains it. When the header started showing up, I found this flag: https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-printToPDF I was (mistakenly) under the impressions that puppeteer was just a wrapper around the command line.
,
Nov 7 2017
From #4 this sounds like it's working as intended, closing as WontFix. |
||||
►
Sign in to add a comment |
||||
Comment 1 by rbasuvula@chromium.org
, Oct 30 2017