Reputation: 71
I am using javascript:print() for taking print in PHP script.I added the background color in that.Actually it will be dynamic background color.While seeing the print preview the background color is not coming.Kindly anyone help in this issue.
Thanks in advance.
Upvotes: 0
Views: 1187
Reputation: 91734
Although @Jan.'s answer is correct and you should not mess with the users preferences and settings, it is technically possible.
Just position an element behind all of your content and put an image in it having your desired background color that stretches to 100% width and 100% height. Using javascript / css this would be pretty easy.
It will annoy (to put it mildly...) people who print the page though...
Upvotes: 0
Reputation: 1995
You can not control this via javascript.
The user may enable printing of background images or color in the printer dialog.
Upvotes: 2