Possible Duplicate:
Prevent PDF file from downloading and printing
I kow we have lots of post to prevent right click on ,
here i'm trying to have an containing PDF where user cannot right click on the pdf for Internet Explorer browser.
The basic idea is to prevent user from copying or printing the pdf file.
I have done following code it works on chrome, but fails badly on IE. FYI - PDF file is on same Domain
<html>
<head>
<title>Disable Context Menu</title>
<script type="text/jscript">
function disableContextMenu()
{
window.frames["fraDisabled"].document.oncontextmenu = function(){alert("Right Click disabled!"); return false;};
// Or use this
// document.getElementById("fraDisabled").contentWindow.document.oncontextmenu = function(){alert("Right Click disabled!"); return false;};;
}
</script>
</head>
<body bgcolor="#FFFFFF" onload="disableContextMenu();" oncontextmenu="return false">
<iframe id="fraDisabled" width="528" height="473" src="landscape.pdf#toolbar=0&navpanes=0" onload="disableContextMenu();" onMyLoad="disableContextMenu();"></iframe>
</body>
</html>
Or is there any other to protect your pdf file working on IE ?