prevent image printing

liunx

Guest
I am about to put some of my own photography work on a web site I am designing. How do i prevent users looking at the web site from printing the images<!--content-->The short answer is, you can't. Whatever you let them see they can print. You can make the image small and/or highly compressed so a print out is low quality but that's about it.<!--content-->the best thing you could do would be to add a watermark to the image so that it is specifically identified as your work.<!--content-->although, if you just want to disable an image from being printed directly from the webpage (for example a very large/colorful image), you could define a print media, and have that image set to display:none. if you do this however, you should have a way to print the image as an alternative<!--content-->like ray said you can't stop them from printing cos they could print screen etc. but heres a script i used for my site, It stops both right and left click:<br />
<br />
<head><br />
<br />
<SCRIPT LANGUAGE="JavaScript1.1"><br />
function right(mousebutton)<br />
{<br />
var msg1 = "copyright ?";<br />
var msg2 = "copyright ?";<br />
<br />
if (navigator.appName == 'Netscape' && mousebutton.which==3)<br />
{<br />
alert(msg1);<br />
return false;<br />
}<br />
else<br />
<br />
if (navigator.appName == 'Netscape' && mousebutton.which==1)<br />
{<br />
alert(msg2);<br />
return false;<br />
}<br />
else<br />
<br />
if (navigator.appName == 'Microsoft Internet Explorer' && event.button == 1)<br />
{<br />
alert(msg1);<br />
return false;<br />
}<br />
else<br />
<br />
if (navigator.appName == 'Microsoft Internet Explorer' && event.button == 2)<br />
{<br />
alert(msg2);<br />
return false;<br />
}<br />
return true;<br />
}<br />
document.onmousedown = right;<br />
// --><br />
</SCRIPT><!--content-->Originally posted by Nadir <br />
like ray said you can't stop them from printing cos they could print screen etc. but heres a script i used for my site, It stops both right and left click:<br />
<br />
<head><br />
<br />
<SCRIPT LANGUAGE="JavaScript1.1"><br />
function right(mousebutton)<br />
{<br />
var msg1 = "copyright ?";<br />
var msg2 = "copyright ?";<br />
<br />
if (navigator.appName == 'Netscape' && mousebutton.which==3)<br />
{<br />
alert(msg1);<br />
return false;<br />
}<br />
else<br />
<br />
if (navigator.appName == 'Netscape' && mousebutton.which==1)<br />
{<br />
alert(msg2);<br />
return false;<br />
}<br />
else<br />
<br />
if (navigator.appName == 'Microsoft Internet Explorer' && event.button == 1)<br />
{<br />
alert(msg1);<br />
return false;<br />
}<br />
else<br />
<br />
if (navigator.appName == 'Microsoft Internet Explorer' && event.button == 2)<br />
{<br />
alert(msg2);<br />
return false;<br />
}<br />
return true;<br />
}<br />
document.onmousedown = right;<br />
// --><br />
</SCRIPT> <br />
No right-click scripts are very annoying, and very useless. I'm pretty sure that if someone comes across your site, and finds out they can't use some feature of their computer, they will leave immediately. Besides, those who really want the images, will get them anyways.<!--content-->
 
Back
Top