Getting Chrome to Print with background colors enabled
Published Tue, 7 Aug 2012 • 7 comments
Chrome has a nice feature which allows it to "Print to PDF" without any native PDF print driver installed. This is really handy for taking "screenshots" of web pages to a portable format like PDF, however one thing which is frustrating is that background colors are forcibly removed for printing, even when printing to PDF.
This makes some sense when printing to a piece of paper, but is often not what you want for printing to PDF. Google has not provided an option to switch this behavior off, however there is a way around it.
- Right click somewhere in the page
- Click "Inspect Element"
- Find the top level "<body ... >" tag in the HTML document
- Double click and add this attribute:
e.g. the full tag might be:
Now when you print, background colors will not be modified.
About the Author
Richard Nichols is an Australian software engineer with a passion for making things.
You might also enjoy reading -
- Use tcpdump to capture web traffic for debugging
- Man's Guide To Making Your Own Wedding Invitations
- Arrrggh! java.security.cert.CertificateException: Certificates does not conform to algorithm constraints
- Roundup - Royalty Free Icons and Images for Web Developers
- Getting nice font rendering in Netbeans 7 on Ubuntu 12.04