Results 1 to 5 of 5

Thread: How I Restrict Printing and Text Copy from my web page?

  1. #1
    Join Date
    Jun 2009
    Posts
    50

    How I Restrict Printing and Text Copy from my web page?

    Hey,
    I am developing web site for my client and in his requirement he doesn’t want to allow his web site user to copying any data and images from his site and also restricting printing the web page or any document on his site. But the problem is I am not able to do it, for that I want your help please suggests me How I Restrict Printing and Text Copy from my web page?
    Thank you in advance.

  2. #2
    Join Date
    Apr 2008
    Posts
    2,276

    Re: How I Restrict Printing and Text Copy from my web page?

    I give you better solution for that because I use this technique in my college web site project, in my project I also Restrict Printing and Text Copy from my web page and because of this I get good marks also and I like to share with use, use following code:

    <body onbeforeprint="return false" onprint="return false" onbeforecopy="return false" oncopy="return false" onbeforecut="return false" oncut="return false">

  3. #3
    Join Date
    May 2008
    Posts
    2,134

    Re: How I Restrict Printing and Text Copy from my web page?

    Hey use following java script in your web page, it’s great java script I use this on my live web page, and I get positive result of that I able to Restrict Printing and Text Copy from my web page.
    Here is a no text select script:

    <script language="JavaScript1.2">


    function disselect(e){
    return false
    }

    function reEnable(){
    return true
    }

    //for IE4+
    document.onselectstart=new Function ("return false")

    //for NS6
    if (window.sidebar){
    document.onmousedown=disselect
    document.onclick=reEnable
    }
    </script>

    use this script for disabling the right click.
    <script language=JavaScript>
    <!--
    var message="";
    function ritclik() {if (document.all) {(message);return false;}}
    function clickNS(e) {if
    (document.layers||(document.getElementById&&!document.all)) {
    if (e.which==2||e.which==3) {(message);return false;}}}
    if (document.layers)
    {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
    else{document.onmouseup=clickNS;document.oncontextmenu=ritclik;}

    document.oncontextmenu=new Function("return false")
    // -->
    </script>

  4. #4
    Join Date
    May 2008
    Posts
    2,792

    Re: How I Restrict Printing and Text Copy from my web page?

    Use this short and sweet code for restrict the printing of the web page, you have to copy past or type in your web page header part, I use maximum of java script but it doesn’t give me exactly what I want. Then I use this code and I it really works.
    <head>
    <link rel=alternate media=print href="blank.htm">
    </head>
    using this code if suppose anyone want to print web page then it prints the blank.htm instead.

  5. #5
    Join Date
    Apr 2008
    Posts
    2,572

    Re: How I Restrict Printing and Text Copy from my web page?

    I think you have to use this code because it’s very short and I think every time you have to use short but useful code if you write maximum line code then it will take long time to compile and it’s not good for your web site when you try to open it, that it will take long time to load for that you have to use following code in your site.

    <html>
    <head>
    <title>Testing</title>
    <style>
    @media print { body {visibility: hidden;}}
    </style>
    <script>
    </script>
    </head>
    <body><span onclick="return false">your texts here</span>
    <h1>Test Page</h1>
    <form>
    </form>
    <script>
    </script>
    </body>
    </html>

Similar Threads

  1. Page formatting for printing with CSS
    By Brruno in forum Software Development
    Replies: 3
    Last Post: 04-01-2011, 07:17 AM
  2. Multi-Page Printing in Adobe AIR
    By Algonkin in forum Windows Software
    Replies: 6
    Last Post: 05-07-2010, 10:43 PM
  3. help on turbo c++ printing text file
    By mstpin in forum Software Development
    Replies: 4
    Last Post: 23-07-2009, 10:18 AM
  4. Replies: 3
    Last Post: 18-06-2009, 09:38 AM
  5. Replies: 0
    Last Post: 18-03-2009, 10:00 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,585,534.34788 seconds with 17 queries