You can easily disable mouse right click in the web page, but it will not work in the <embed> and IFrame. If you want to disable right click in embed tag, JavaScript onmousedown event help to do that easily.
The main purpose of disabling right click is to prevent the user from saving the PDF or document content. In this tutorial shows how to disable right click in a pdf file opened in the iframe or <embed> tag.
The following example code will disable right-click on embedded PDF using JavaScript.
<script type="text/javascript"> document.onmousedown = disableRightclick; var message = "Right click not allowed !!"; function disableRightclick(evt){ if(evt.button == 2){ alert(message); return false; } } </script>
Thanks for the contribution but when I implement it, it only works outside the embedded PDF Document. How do I apply it within the embedded pdf? Thanks Again
great thank you
how to call in embed tag???
Just add this code in the webpage where
embed
tag is placed and you want to disable the right mouse click.