Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to print a php generated document in Chrome. On the browser it looks fine, but my printer will not print any coloured backgrounds. I know that IE has an option to print background but Chrome does not.

As the end user will print this off, I do not want to find alternatives like a screen grab or save file etc. I want to find a real solution to this.

Here is the page i want to print, for information

Can anyone offer a suggestion please?

share|improve this question

7 Answers 7

There's a long long two years old thread at Chrome support, full of users complaining exactly how ludicrous is the lack of so basic function, as background printing, in Chrome.

http://www.google.com/support/forum/p/Chrome/thread?tid=17a4ac343580c8d3&hl=en

TWO Years!

My advice is to use Firefox or Opera until we get heard at Google.

share|improve this answer
1  
basic sure, popular, no. –  Jody Mar 18 '11 at 13:00
    
there's a solution now! see down there! –  Stefano Dec 22 '12 at 22:41

There is now a chrome extension that injects -webkit-print-color-adjust:exact. I tested it with Chrome 23 and works fine.

https://chrome.google.com/webstore/detail/print-background-colors/gjecpgdgnlanljjdacjdeadjkocnnamk

share|improve this answer

Considering that it seems to me that the OP was "CREATING" the page, this belongs to stackoverflow rather then SuperUser.

In any case, the good solution is... NOT to use background-color and background-image! ...also because Chrome is still not supporting printing them (Jan 2012!), and even with other browsers the user have to go through printing options...

If you are creating the page it's reasonable. See for instance: http://stackoverflow.com/a/2966004/422670

I use something like:

<div class='container'>
    <img src='background-image or color' class='background'/>
    normal stuff as it should be
</div>

then in css:

img.background {
    position: absolute;
    z-index: -1;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

of course you can then adapt the css and the classes to your use

share|improve this answer

It sounds like it's finally coming:

for the moment in the form of a specific -webkit style:

see http://code.google.com/p/chromium/issues/detail?id=2294

-webkit-print-color-adjust:exact;

I could not find an option in chrome but if you are editing the page you can add it; otherwise simply fire the developers tool and add this style to the body.

Works!!!!!!

A very different answer from myself ;-)

share|improve this answer

Instead of printing it directly from the browser, try taking a screen shot and printing it from an image editor.

share|improve this answer
    
Doesn't work if it's more than one screen long. Also, most designers will set different styles for screen and print using the media attribute of the style tag: fonts that work better in each media, maybe removing images or ads from the printed version, etc. Printing from a screenshot defeats this effort. –  Nathan Long Oct 31 '11 at 13:58

Use Internet Explorer as this option is not in Chrome. Go to file - page setup - print background colors and images and check it.

Or, in IE, go to tools - internet options - advanced - printing - print background colors and images

share|improve this answer
1  
-1 This question is specifically about Google Chrome. If the user asked "How can I do X in Ubuntu?", responding with "You can do X in Windows by..." would not be a good answer. –  iglvzx Jun 7 '12 at 6:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.