2 Replies - 1732 Views - Last Post: 20 September 2006 - 11:30 AM

#1 chitara  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 89
  • Joined: 16-December 05

print lock

Posted 20 September 2006 - 12:00 AM

I want to make a html page where printing option will be disabled in the browser in every sense.

Can anyone tell me please how is it possible???

Is This A Good Question/Topic? 0
  • +

Replies To: print lock

#2 capty99  Icon User is offline

  • i am colt mccoy
  • member icon

Reputation: 98
  • View blog
  • Posts: 10,081
  • Joined: 26-April 01

Re: print lock

Posted 20 September 2006 - 12:33 AM

your not gonna be able to do it in straight html because printing is an ability the browser has and the webpage has no control over.

with css, you can disable
<style type="text/css" media="print">
BODY {display:none;visibility:hidden;}

or another way would be to put the information in a pop-up window where all the taskbars and right - click is disabled. the user can work around this if they have some internet know-how but it is definitely a deterrent.
Was This Post Helpful? 0
  • +
  • -

#3 Arbitrator  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 51
  • View blog
  • Posts: 530
  • Joined: 26-January 05

Re: print lock

Posted 20 September 2006 - 11:30 AM

Yeah, you can do this with CSS but that's also its weakness since the user can simply disable stylesheets. Of course, you could make it so that whatever it is you want to keep from being printed will only display if CSS is enabled, but there are ways to circumvent that also; for example, they could save your page, edit the markup to remove references to the print stylesheet, and print it. Or they could use a custom stylesheet to override yours. The easiest solution would be to download the Web Developer Extension for Firefox, which allows the user to disable CSS for a website on a stylesheet by stylesheet basis, or to even edit that website's CSS line-by-line.

So there's basically no full-proof way to do this except to put the content into media that isn't printable. Examples might be animated media such as images, Flash, Java, etc. Of course, the user could take a screenshot of their desktop with Print Screen…

I think capty99's suggestion should work fine, though you could be a little more comprehensive by using the universal selector to select everything:

* {display: none;}
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1