This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Stylesheets > September 2005 > Printing Background colors





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Printing Background colors
J. B. Moreno

2005-08-19, 7:35 pm

I read the faq, and it mentions that IE 4 on windows requires setting a
printing option to allow background colors to be printed.

Things change, life goes on, other browsers come into existence....

So, is there a way in CSS to say "Yeah, print these background colors",
without the user having to turn on an option that will then apply to all
pages printed?

Thanks,

--
J.B.Moreno
Els

2005-08-19, 7:35 pm

J. B. Moreno wrote:

> I read the faq, and it mentions that IE 4 on windows requires setting a
> printing option to allow background colors to be printed.
>
> Things change, life goes on, other browsers come into existence....
>
> So, is there a way in CSS to say "Yeah, print these background colors",
> without the user having to turn on an option that will then apply to all
> pages printed?


Fortunately not. I don't want you to have any power over how much
(coloured) ink I have to pay for :-)

NB: ask on Usenet, get reply on Usenet. Don't set email to poster
headers.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: The Smiths - Bigmouth Strikes Again
J. B. Moreno

2005-08-19, 7:35 pm

Els <els.aNOSPAM@tiscali.nl> wrote:
> J. B. Moreno wrote:

-snip-
>
> Fortunately not. I don't want you to have any power over how much
> (coloured) ink I have to pay for :-)


Well, the intended printer(s) would be laser printers, but if it can't be
done, it doesn't matter.

Thanks, guess instructions will be in order...

> NB: ask on Usenet, get reply on Usenet. Don't set email to poster
> headers.


I used the Mail-Copies-To header, which as it's name suggest, requests a
mail COPY of the usenet post be sent to me. I'm not trying to move the
discussion off of usenet or anything else like that -- this isn't a drive
by post, and while I don't read the group a lot, I am subscribed to it.

--
J.B.Moreno
Harlan Messinger

2005-08-19, 7:35 pm

J. B. Moreno wrote:
> Els <els.aNOSPAM@tiscali.nl> wrote:
>
>
> Well, the intended printer(s) would be laser printers, but if it can't be
> done, it doesn't matter.


You think laser printers don't use ink (or toner or something)?!
C A Upsdell

2005-08-19, 7:35 pm

J. B. Moreno wrote:
> I read the faq, and it mentions that IE 4 on windows requires setting a
> printing option to allow background colors to be printed.
>
> Things change, life goes on, other browsers come into existence....
>
> So, is there a way in CSS to say "Yeah, print these background colors",
> without the user having to turn on an option that will then apply to all
> pages printed?


No. But there is a way to specify different CSS for printing, so you
can avoid many problems. E.g., in one site I have:

@media print
{ a, a:link, a:visited, a:active, a:hover { color:#000; }
body, html { margin:0; padding:0; }
html { background-color:#fff; background-image:none; }
}
J. B. Moreno

2005-08-19, 7:35 pm

Harlan Messinger <hmessinger.removethis@comcast.net> wrote:

> J. B. Moreno wrote:
-snip-[color=darkred]
>
> You think laser printers don't use ink (or toner or something)?!


Except for thermal printers, they all use SOMETHING (and they use
electricity). But color ink is a lot more expensive than toner on a
standard laser printer (don't know about color laser printers, but at a
guess, I'd say more than them too).

Besides that -- I know how to fake it, so if the point was to use up your
expensive ink, it could be done (the foreground color prints, so there you
are), I was just looking for something that wouldn't be more trouble than
it's worth.

--
J.B.Moreno
J. B. Moreno

2005-08-19, 7:35 pm

C A Upsdell <""cupsdellXXX\"@-@-@XXXupsdell.com"> wrote:
> J. B. Moreno wrote:
>
> No. But there is a way to specify different CSS for printing, so you
> can avoid many problems. E.g., in one site I have:
>
> @media print
> { a, a:link, a:visited, a:active, a:hover { color:#000; }
> body, html { margin:0; padding:0; }
> html { background-color:#fff; background-image:none; }
> }


I was hoping for something along those lines, but with background-color
being respected -- your example implies that it is respected (your setting
the background-color to white) under those circumstances, but I'd guess
that's a false hope based upon the other comments.

--
J.B.Moreno
C A Upsdell

2005-08-19, 7:35 pm

J. B. Moreno wrote:
> C A Upsdell <""cupsdellXXX\"@-@-@XXXupsdell.com"> wrote:
>
>
>
> I was hoping for something along those lines, but with background-color
> being respected -- your example implies that it is respected (your setting
> the background-color to white) under those circumstances, but I'd guess
> that's a false hope based upon the other comments.


Hmmm, actually I set the background colour to white, assuming the paper
is white, so that Print Preview gives me a reasonable representation of
what will be printed, and so that the background will be white if the
user's browser is configured to print backgrounds.

Of course, one of my motives for specifying CSS for printing is to
prevent ink/toner from being wasted in printing unnecessary backgrounds.

BTW, if you plan to tell the user how to enable background printing, one
of my FAQs may help you: http://www.upsdell.com/site/faq.htm#print




Sander Tekelenburg

2005-08-19, 11:18 pm

In article <20050819170105.332$Go@newsreader.com>,
J. B. Moreno <planb@newsreaders.com> wrote:

> C A Upsdell <""cupsdellXXX\"@-@-@XXXupsdell.com"> wrote:


[...]


[...]
[color=darkred]
> I was hoping for something along those lines, but with background-color
> being respected -- your example implies that it is respected (your setting
> the background-color to white) under those circumstances, but I'd guess
> that's a false hope based upon the other comments.


The essential thing is to realise that on the 'net the end user is
always in control, not the author. As an author you can make suggestions
as to how you think your content would best be presented, but no more.
You have zero control. The user has all control. (Whether a given user
is aware of that is a different issue.)

It's no different from Usenet: I'm typing this in my preferred
newsclient, with my preferred font, fontsize and colours. You'll read it
in your preferred newsclient, with your preferred font, fontsize,
colours, etc.

--
Sander Tekelenburg, <http://www.euronet.nl/%7Etekelenb/>
J. B. Moreno

2005-08-22, 7:31 pm

tekelenb@euronet.nl wrote:
> In article <20050819170105.332$Go@newsreader.com>,
> J. B. Moreno <planb@newsreaders.com> wrote:
>
>
> [...]
>
>
> [...]
>
>
> The essential thing is to realise that on the 'net the end user is
> always in control, not the author. As an author you can make suggestions
> as to how you think your content would best be presented, but no more.
> You have zero control. The user has all control. (Whether a given user
> is aware of that is a different issue.)


As an author, it's my job to at least try to present my stuff in what I
think will be the most effective manner: that does the job with the least
effort and maximum rewards.

Letting the reader override what I do is fine, not allowing me to do it in
the first place is another matter entirely.

And while it makes sense to automatically block background colors and
images from printing where the media type is "all" or "screen", it doesn't
make sense to automatically block them when the media type is "print".

Creating a good UI to present the choices to the user, may be more work
than anyone wants to do, but that doesn't change the fact that there is a
difference between the two situations.

In fact, by NOT acknowledging the difference, the most likely result is
that the author will take control away from the user -- for instance, I'll
probably use foreground colors, absolute positioning, and Z-index to get
the result I want, and the user won't be able to turn it off (in this
context, that doesn't really matter, as the user wouldn't really have a
choice anyway, but in general, it's a bad thing, and it's a PITA for me).

--
J.B.Moreno
J. B. Moreno

2005-08-23, 8:23 pm

tekelenb@euronet.nl wrote:
> In article <20050822092503.923$fH@newsreader.com>,
> J. B. Moreno <planb@newsreaders.com> wrote:

-snip-
>
> I don't know much about printing, but I think in practice setting the
> background colour to white for print media, which you can do with CSS,
> results in no background colour being printed. If a user-agent ignores
> that, it will be either because it is broken or because the user chose
> to override yours suggestion. In either case, as an author you have no
> control.


The issue is that setting the bacground color does NOTHING unless you first
get the user to make a change in his preferences -- IMO this is broken
behavior (not that I expect my opinion to result in a change), if there's a
media type for print, and it specifies a background, then that background
should be used by default.

Since it isn't, I (as the author) have three choices: forget about how it
looks when printed (not an option in this particular case as the whole
point is to go to paper), provide instructions to the user for how to turn
on background printing, or make my own "background" elements which are
really layered foreground elements. But if the author fakes a background,
it's the user that has no control...

--
J.B.Moreno
Sander Tekelenburg

2005-08-23, 8:23 pm

In article <20050823093818.821$PX@newsreader.com>,
J. B. Moreno <planb@newsreaders.com> wrote:

> tekelenb@euronet.nl wrote:


[...]

> The issue is that setting the bacground color does NOTHING unless you first
> get the user to make a change in his preferences [...]
>
> Since it isn't, I (as the author) have three choices: forget about how it
> looks when printed (not an option in this particular case as the whole
> point is to go to paper)


If printing to paper is the whole point, I'd think it would make more
sense to publish as PDF instead of HTML.

--
Sander Tekelenburg, <http://www.euronet.nl/%7Etekelenb/>
kchayka

2005-08-23, 8:23 pm

J. B. Moreno wrote:
>
> I don't know how to output a PDF from a webpage


There are many scripts and utilties that do this, I believe there are
several for PHP alone. google is your friend. ;)

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
J. B. Moreno

2005-08-23, 8:23 pm

tekelenb@euronet.nl wrote:

> J. B. Moreno <planb@newsreaders.com> wrote:
>
>
> [...]
>
>
> If printing to paper is the whole point, I'd think it would make more
> sense to publish as PDF instead of HTML.


It's running off of a dynanmic web page, I don't know how to output a PDF
from a webpage...and I wouldn't want any unnecessary steps for the user.
If they clicked on a "print now" button, it should print now, not popup
with something else that then requires them to choose to print it again.

--
J.B.Moreno
Sander Tekelenburg

2005-08-23, 8:23 pm

In article <20050823162008.514$hE@newsreader.com>,
J. B. Moreno <planb@newsreaders.com> wrote:

> tekelenb@euronet.nl wrote:


[...]

>
> It's running off of a dynanmic web page, I don't know how to output a PDF
> from a webpage...


You use whatever scripting language you're comfortable with (IIRC you're
comfortable with Perl) and is available on your server to have some tool
running on your server print the page to PDF (I'm sure there are cli
tools that can do that). You can have a hyperlink activate this process
which, as its final action, returns the PDF. From the user's point of
view it would just be a "download PDF" link. Your server does the magic
of generating that PDF on the fly.

> and I wouldn't want any unnecessary steps for the user.


I can't think of a way to make it less than those 2 steps: [1] click
hyperlink to fetch PDF, [2] hit the local print button. I can't discover
anything unnecessary in that.

It might be possible to make that hyperlink activate some piece of
javascript that automagically prints the PDF. But you can't be sure
javascript will be available so shouldn't make things dependant on that.
(In fact I think there's a good chance this sort of extra service will
only confuse users.)

> If they clicked on a "print now" button, it should print now, not popup
> with something else that then requires them to choose to print it again.


Indeed. So don't call that link "print now", but "download very pretty
printable version" ;)

--
Sander Tekelenburg, <http://www.euronet.nl/%7Etekelenb/>
Amedee Van Gasse

2005-09-19, 7:20 am

J. B. Moreno schreef:

> tekelenb@euronet.nl wrote:
> -snip-
>
> The issue is that setting the bacground color does NOTHING unless you first
> get the user to make a change in his preferences -- IMO this is broken
> behavior (not that I expect my opinion to result in a change), if there's a
> media type for print, and it specifies a background, then that background
> should be used by default.
>
> Since it isn't, I (as the author) have three choices: forget about how it
> looks when printed (not an option in this particular case as the whole
> point is to go to paper), provide instructions to the user for how to turn
> on background printing, or make my own "background" elements which are
> really layered foreground elements. But if the author fakes a background,
> it's the user that has no control...


Excuse me for hijacking this thread, but have you found a solution?
I have a similar problem. A FoxPro program creates a calender with
various colors depending on the type of activity per day. Up to 8
colors are possible.

On screen this looks as requested by the customer, but on paper we just
get empty white squares. The customer cannot change the "print
background colors" setting because of security settings on the Citrix
server.

I tried @media print, but that made no difference.

How can this be solved?

--
Amedee Van Gasse

Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews