/chrome/community?hl=en
/chrome/community?hl=en
9/7/17
Original Poster
Gifford Cheung

Headless Chrome --print-to-pdf removing header & footer

Hi,

I would like to ask if there is a command line option to use together with --headless and --print-to-pdf to remove the header and footer (this would be the same behavior as clicking the unchecking the "Headers and footers" box in your normal Chrome print view).

I am hoping to use this feature to print local html files into pdfs that are to be distributed to users. The header and footer would otherwise display the local filename and directory in the printout. 

Thank you

Community content may not be verified or up-to-date. Learn more.
All Replies (4)
Tina - Community Specialist
9/8/17
Tina - Community Specialist
Hi Gifford,

Thanks for posting on the Google Chrome Help Forum.

I see that you are using Chrome Beta, which is the cutting edge developer version of Chrome. I’d recommend you installing Chrome Stable and check if that works. It has gotten the full testing and is the updated version. It is the best bet to avoid crashes and other issues.

Also, please confirm if you are on a domain or a manage system. If yes, are you the administrator? If yes, please confirm so that I can move your post to the appropriate forum for further help. If not, I suggest getting in touch with the administrator for further assistance.

If that is not the case, please confirm if you are developing something on Chrome.

Keep me posted.

Best,
Tina
Riccardo Serafini
9/20/17
Riccardo Serafini
Up! This would be so usefull!
Riccardo Serafini
9/20/17
Riccardo Serafini
Actually this did the job for me:
https://stackoverflow.com/questions/44575628/alter-the-default-header-footer-when-printing-to-pdf

 @page { 
     margin: 0;
     size: auto;
 }
Tina - Community Specialist
9/21/17
Tina - Community Specialist
Hi Riccardo,

Thanks for posting on the Google Chrome Help Forum.

I appreciate sharing the information. Glad to hear the issue is fixed.

Reach out if you have any more questions.

Best,
Tina
Were these replies helpful?
How can we improve them?
 
This question is locked and replying has been disabled. Still have questions? Ask the Help Community.

Badges

Some community members might have badges that indicate their identity or level of participation in a community.

 
Expert - Google Employee — Googler guides and community managers
 
Expert - Community Specialist — Google partners who share their expertise
 
Expert - Gold — Trusted members who are knowledgeable and active contributors
 
Expert - Platinum — Seasoned members who contribute beyond providing help through mentoring, creating content, and more
 
Expert - Alumni — Past members who are no longer active, but were previously recognized for their helpfulness
 
Expert - Silver — New members who are developing their product knowledge
Community content may not be verified or up-to-date. Learn more.

Levels

Member levels indicate a user's level of participation in a forum. The greater the participation, the higher the level. Everyone starts at level 1 and can rise to level 10. These activities can increase your level in a forum:

  • Post an answer.
  • Having your answer selected as the best answer.
  • Having your post rated as helpful.
  • Vote up a post.
  • Correctly mark a topic or post as abuse.

Having a post marked and removed as abuse will slow a user's advance in levels.

View profile in forum?

To view this member's profile, you need to leave the current Help page.

Report abuse in forum?

This comment originated in the Google Product Forum. To report abuse, you need to leave the current Help page.

Reply in forum?

This comment originated in the Google Product Forum. To reply, you need to leave the current Help page.