Roland M?sl wrote:

>"Burpmaster" <[EMAIL PROTECTED]> wrote in message
>news:[EMAIL PROTECTED].;
>
>>Hello!
>>
>>Roland M?sl wrote:
>>
>>>ftp://ftp.microsoft.com/developr/platformsdk/oct2000/common/help/
>>>
>>>inet.chm
>>>inet.chi
>>>
>>>put in index the word "print Method" to find onbeforeprint and onafterprint
>>>
>>In other words, it's not a standard.
>>You're much better off adding CSS rules for styling on printed media.
>>It's probably easier anyway.
>>
>Hot to fire with a CSS rule a javascript?
>
With CSS media rules, you don't need to. You simply specify sets of 
rules the apply to different media types such as all media, printed 
media, screen media, aural media, braille, etc. For example:
@media print {
div#menubutton {
display: none;
}
}

In this example, the menu button is hidden in the printout, eliminating 
the end user's urge to poke at the paper.
You can also remove navigation buttons which don't make sense on paper, 
as well as links like "Contact me."
For those links which are true hyperlinks, clickable segments of a 
sentance, you can take out the blue coloring and underlining.

@media print {
a {
text-decoration: none;
color: black;
}
.dontprint {
display: none;
}
}

And then:
<a href="http://www.mozilla.org"; class="dontprint">Mozilla homepage</a>
My homepage is at <a 
href="http://truffula.net/~burpmaster";>http://truffula.net/~burpmaster</a>
I like the web comic known as <a href="http://www.ozyandmillie.org/";>Ozy 
and Millie</a>.

In this case "Mozilla homepage", which on paper is a stray and 
meaningless sentance, is eliminated from the printout.
The next two sentences above keep the text in the link names, but the 
blue coloring and underlining is removed, since it doesn't make sense on 
paper.

If you wanted to provide URL's for certain links you are showing, it's 
simple:
@media print {
a.printurl:after {
content: " <" attr(href) ">";
}
}

The html:
Standards are developed by the <a href="http://www.w3.org/"; 
class="printurl">W3C </a>.

comes out on the printer as:
Standards are developed by the W3C <http://www.w3.org/>

You'd probably want to set this on most external links which name where 
you are linking. In fact, the class could be named "external" and you 
could set different link colors while you're at it, to take advantage of 
the new information in your document on whether links are external. This 
sort of thing is the main idea of CSS.

But I guess what you want most of all is position and sizing with CSS, 
and this is possible, too. Just remember, printers don't want pixel 
measurements. You should use centimeter, inch, and point, etc 
measurements. Also, you can specify the intended page size, and tell the 
browser to scale down if your layout is bigger than the user's page size.

The following URL's may prove useful:
http://www.w3.org/TR/REC-CSS2/page.html
http://www.w3.org/TR/REC-CSS2/media.html

Finally, I have made a short attachment, showing a small portion of what 
you can do with printers and CSS in general.
Try viewing it with Mozilla's print preview.

Title: print me!
Do you dare print this white on black page?
Yes, because it's custom tailored to multiple media types, thanks to the wonderful standard known as CSS.
NOTICE: I have ensured that this page will print well.

Reply via email to