dcsimg
www.webdeveloper.com
Results 1 to 11 of 11

Thread: Disable Printing

  1. #1
    Join Date
    Nov 2006
    Posts
    6

    Disable Printing

    Hi, is it possible to disable printing on a page through HTML? I've read its possible to use a setting that makes pages print as blank but not sure if this was through specific software

    Any help appreciated

  2. #2
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,279
    Yes it can be done and quite easily.

    But to be frank I don't want people knowing about it. When I want to print a page I want it to print.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  3. #3
    Join Date
    May 2005
    Location
    Northern Indiana
    Posts
    597
    I believe I know what Charles has in mind (and I agree with his sentiments), but even that isn't foolproof. Someone could easily take and print screen captures, copy the text/images to be printed to another application and print there, etc. You can "optimize" a page for printing fairly easily, but disabling printing entirely wouldn't really be possible, if someone really wanted to print your page- especially considering how easy it is to use tools like Firebug & GreaseMonkey to alter the contents & behaviors of a given page.

  4. #4
    Join Date
    Feb 2006
    Posts
    90
    Both Guru advise are right !

    Anyway, you can try this

    <style type="text/css" media="print">
    .noprint { display:none }
    </style>


    <body>
    <div> This can print</div>
    <div class="noprint"> This can't print</div>
    <div> This can print</div>
    </body>

  5. #5
    Join Date
    Nov 2006
    Posts
    6
    no bother. It was just to prevent sensitive information being printed on an internal site i'll be writing. I agree there other methods of copying the data such as print screen however this was just a way of blocking 1.

    i'll see what I can find out

    regards

  6. #6
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,279
    "Print screen" is the least elegant of the ways to bypass this.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  7. #7
    Join Date
    Jun 2005
    Location
    United Kingdom
    Posts
    1,043
    Quote Originally Posted by Charles
    "Print screen" is the least elegant of the ways to bypass this.
    Exactly. And if the idea is to hide a long document from printing, disabling CSS in the browser would as well.

  8. #8
    Join Date
    May 2005
    Location
    Northern Indiana
    Posts
    597
    Quote Originally Posted by kiwibrit
    Exactly. And if the idea is to hide a long document from printing, disabling CSS in the browser would as well.
    Unless someone uses any number of free and fairly basic tools (including IE's Dev Bar or FireBug for FF) to alter your document on the fly- these tools make it a snap to change CSS definitions, and the results are displayed locally immediately. Granted, it would be an extra step in the printing process, but it wouldn't take more than a couple seconds to achieve.

  9. #9
    Join Date
    Jun 2005
    Location
    United Kingdom
    Posts
    1,043
    I wasn't saying that CSS could be used to stop printing. I was saying the reverse.

  10. #10
    Join Date
    Mar 2005
    Location
    Sydney, Australia
    Posts
    7,974
    You can always add your own stylesheet in your browser to override the noprint class so that it always prints.

  11. #11
    Join Date
    Jan 2005
    Posts
    446
    you can always do EDIT->Select All and then paste in word and print

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles