I know this question was asked and answered a long time ago, but I came across it and felt that I should throw my 2 cents in. I have a program that has some copyright information in it, we would prefer that the end user not be able to print this information, so what I did was create a separate div that I gave the class .printable
.
I added these lines to the CSS sheet
.printable { display:none; }
@media only print {
.container { display:none !important; } <-- This is the wrapper container for all of the site data
.printable { display:block !important; } <-- This is my added printable container with a message about not printing the page
}
With the improvements in the new CSS engines in the major browsers, even if they do a right click + print, it will display the .printable
box instead of the content.
However, it has been pointed out, that there is no way to prevent a user from using a piece of screen capture software to print the information if they really wanted to. We felt that by discouraging the printing, we will stop about 99% of the people who might have otherwise printed the information.
So that's my 2 cents... hope it helps someone