How can I close a webpage when PRINTING is activated?

M

Marcello do Guzman

I can't really stop somebody from printing my webpages, but is it
possible to close the webpage the second PRINTING is activated?
 
D

David Berry

Even if you could disable the print button in the browser a user will be
able to find other ways to print the document, they could cut and paste it
into a word processor, they could edit the source, save it to their system
and print that, they could capture an image of the screen and print that,
etc, etc, etc...

You could try a CSS "trick" that may help a little. Since you can never
totally stop this, as your webpage is shown clientside, but you can try and
fool your visitors with a little CSS "trick"

<style type="text/css" media="print">


BODY {display:none}


</style>

Insert this, and when your visitors try to print the webpage, nothing will
show up. It tells via stylesheet that the BODY tag and it's contents should
not be rendered when viewed on the media called print
 
M

Marcello do Guzman

David,

Thank you very much. I added the CSS code and it worked like a charm.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top