0

As we all know normally we call background(Div background, table background etc...) color or images from css but when we check same page as a print preview those properties does not appear.

Is any one know how to fix it?

Thanks AV

The AV
  • 609
  • 3
  • 7
  • 17

3 Answers3

1

By default these aren't displayed, however the user can change the settings of this in their browser:

http://support.microsoft.com/kb/296326

http://malektips.com/firefox_0026.html

this will be useful as it explains how you can use a print css to display some items when printing: How can I print background images in FF or IE?

Community
  • 1
  • 1
Mike Sav
  • 14,805
  • 31
  • 98
  • 143
0

Background-colors are disabled in the print preview of some browsers to be more economic and save ink.

I'm not sure, but declaring them explicitly in the print-css could help (Declare mediatype print for that):

<link rel="stylesheet" type="text/css" href="print.css" media="print" />

In every case, the user can configure his browser to print the background-colors.

Christoph
  • 50,121
  • 21
  • 99
  • 128
  • Thanks Christoph, I am using same media print but it did not work – The AV Aug 09 '12 at 12:10
  • @TheAV well, then you can't do anything, you cannot circumvent the settings of the browser... If you really need those images, 1) prompt the user to change his print-settings or 2) Declare those background-images as real images in the print-stylesheet. (You need to add hidden images for that) – Christoph Aug 09 '12 at 12:11
  • Yes I think I need to little play with table trick as print preview does not support css, but my trick will be take much time and not proper way even...anyways still waiting for proper solutions :( – The AV Aug 09 '12 at 12:15
  • @TheAV see, if [this link](http://stackoverflow.com/questions/596876/how-can-i-print-background-images-in-ff-or-ie) can help you. – Christoph Aug 09 '12 at 12:19
  • in AntonioCS post, he facing same problem and its looks still unsolved puzzle – The AV Aug 09 '12 at 12:38
  • well, (luckily) the webdeveloper has no control over the settings of the user's browser. Try if some of those workarounds might work for you. – Christoph Aug 09 '12 at 12:41
0

Those properties don't appear in print-preview because printers don't print them. So you're seeing it how it will get printed out.

There is no way for you, the developer, to fix this.

the end-user, depending on the browser s/he uses, can edit his/her printer options in the print dialog to get this to print out, but you cannot control that.

Faust
  • 15,130
  • 9
  • 54
  • 111