Vitanuova for 2004 December 17 (entry 0)

< In the Superior Court of California, County of San Mateo
Body language and perspectives in People v. Barlow >

I am having a problem related to CSS. (I suppose we all have a problem related to CSS, but this is a printing kind of problem rather than a cartels-and-censorship kind of problem.)

So perhaps I should say that I'm having a browser problem. I should probably submit this in Bugzilla, but maybe I have readers who can help here.

Suppose you have the following HTML document:

<html>
<head>
<title>simple css background</title>
<style type="text/css" media="all">
.lorem {
background-image: url("http://upload.wikimedia.org/wikipedia/en/2/23/CiceroBust.jpg");
};
</style>
</head>
<body>
<p class="lorem">
Nobody loves pain because it is pain. Nobody loves pain because it is pain. Nobody loves pain because it is pain. Nobody loves pain because it is pain. Nobody loves pain because it is pain. Nobody loves pain because it is pain. Nobody loves pain because it is pain. Nobody loves pain because it is pain. Nobody loves pain because it is pain. Nobody loves pain because it is pain. Nobody loves pain because it is pain. Nobody loves pain because it is pain. Nobody loves pain because it is pain. Nobody loves pain because it is pain. Nobody loves pain because it is pain. Nobody loves pain because it is pain. Nobody loves pain because it is pain. Nobody loves pain because it is pain. Nobody loves pain because it is pain. Nobody loves pain because it is pain. Nobody loves pain because it is pain. Nobody loves pain because it is pain. Nobody loves pain because it is pain. Nobody loves pain because it is pain. Nobody loves pain because it is pain. Nobody loves pain because it is pain. Nobody loves pain because it is pain. Nobody loves pain because it is pain. Nobody loves pain because it is pain. Nobody loves pain because it is pain. Nobody loves pain because it is pain. Nobody loves pain because it is pain.
</p>
</body>
<html>

Some people will observe that the background image of Cicero shows up on the screen but not in the printed version or even in Print Preview, notwithstanding the media="all" attribute.

"Aha!", says the standard advice. "You just need to enable 'Print Background (colors & images)' in your Page Setup dialog!"

This done, the background image of Cicero now shows up perfectly in Print Preview. However, it still doesn't print.

Indeed, printing to a PostScript file makes it very clear that the CSS background image does not print at all, even with media="print". But it does consistently show up in Print Preview, so that Print Preview and the actual print output are consistently different from one another.

Here is what Print Preview looks like after turning on "Print Background (colors & images)":

And here is what the actual printed output looks like immediately afterward:

Note that the background image is completely absent from the printed output even though it is present in the preview.

I have this problem with Firefox 1.0 and also with Mozilla 1.7.


[Main]
Support Bloggers' Rights!
Support Bloggers' Rights!


Contact: Seth David Schoen