Go Back   TechArena Community > Technology > Technology & Internet
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , , , , ,

Sponsored Links



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

Technology & Internet


Reply
 
Thread Tools Search this Thread
  #1  
Old 25-01-2010
Member
 
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.
Reply With Quote
  #2  
Old 25-01-2010
Techno01's Avatar
Member
 
Join Date: Apr 2008
Posts: 2,269
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:

Quote:
<body onbeforeprint="return false" onprint="return false" onbeforecopy="return false" oncopy="return false" onbeforecut="return false" oncut="return false">
Reply With Quote
  #3  
Old 25-01-2010
johnson22's Avatar
Member
 
Join Date: May 2008
Posts: 2,107
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:

Quote:
<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>
Reply With Quote
  #4  
Old 25-01-2010
Trio's Avatar
Member
 
Join Date: May 2008
Posts: 2,754
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.
Quote:
<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.
Reply With Quote
  #5  
Old 25-01-2010
deveritt's Avatar
Member
 
Join Date: Apr 2008
Posts: 2,525
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.

Quote:
<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>
Reply With Quote
Reply

  TechArena Community > Technology > Technology & Internet


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How I Restrict Printing and Text Copy from my web page?"
Thread Thread Starter Forum Replies Last Post
Page formatting for printing with CSS Brruno Software Development 3 04-01-2011 07:17 AM
Multi-Page Printing in Adobe AIR Algonkin Windows Software 6 05-07-2010 11:43 PM
help on turbo c++ printing text file mstpin Software Development 4 23-07-2009 11:18 AM
A free software to lock folder and restrict a web page in firefox Samra Windows Software 3 18-06-2009 10:38 AM
Copy Text from One Cell to Another in Microsoft Excel without copy & paste Computer_Freak Tips & Tweaks 0 18-03-2009 11:00 PM


All times are GMT +5.5. The time now is 06:18 AM.