Print Web page with background colors
-
10-07-2019 - |
Question
I have a javascript backed 'print' button on my webpage where the user can print the webpage.
This works ok except the background color of various elements does not print.
Is there a method of printing a web page whereby the background color of the various elements will print?
Solution
Printing the background is browser setting and not something you can control programatically through client side scripting.
OTHER TIPS
Even if you could, you shouldn't. There's a reason browsers default to ignore the background when printing - ink is expensive!
Under the definition for "background": A position or area of relative inconspicuousness or unimportance.
Unimportance. It's not important enough to override the local user's decision to save money. If it needs to be printed, it's not really part of the background.