While we do not recommend preventing the printing of pages, it is possible with a very simple style sheet. With a stylesheet you can make it more difficult, but not impossible, for the user to print a web page. You define
a print style sheet that turns off the display of the body causing there to be nothing to print:
This prevents the page from printing when the user browses to the page. However, you cannot prevent the viewing and printing of the page from a browser that does not support media style sheets, or the saving of the file locally and manually remove the print style sheet.
Currently this article contains the only pages on the site with print style sheets defined (yes, printing was also an afterthought for us :-). If you choose to print other articles on this site, you will get our default screen style sheet.
With Internet Explorer 5.0, you can even write custom scripts that rearrange your page before printing. For an example, see our article, A Cure for our Printing Blues where we show you how to dynamically reformat PRE elements to fit on standard paper.
© 1997-2000 InsideDHTML.com, LLC. All rights reserved.