New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 779235 link

Starred by 3 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

printToPdf - headers and footers are always visible

Reported by jo...@hazardscout.com, Oct 27 2017

Issue description

UserAgent: 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.
 
output.pdf
87.1 KB Download
Components: -Platform>DevTools Internals>Headless
Components: Internals>Printing Internals>Plugins>PDF
Cc: jzfeng@chromium.org
Hello again. I'm not sure where you got your information, but there is no "--display-header-footer" flag in Chromium.
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.
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.
Status: WontFix (was: Unconfirmed)
From #4 this sounds like it's working as intended, closing as WontFix.

Sign in to add a comment