Click here to Skip to main content
15,890,825 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all,
 
I have a loaded the PDF document in the .aspx page using embed tag. In that loaded PDF document, i should disable the right click event, which gives the options to save the document by the end user.
 
usual jquery which disables right click event is not working for this scenerio. any help would be appreciated , thanks in advance.
 
Jquery event


What I have tried:

$("body").on("contextmenu", function () {
return false;
});
<pre lang="Javascript">
Posted
Updated 17-Nov-19 23:03pm

1 solution

The document is being shown by the PDF viewer installed on the client machine and you have no idea what that viewer is and there is no universal way to disable right click. Even if you could disable right client it is pointless against saving as my viewer might have a "Save" icon without having to right-click. Further more, the fact that it is in my browser means I've already downloaded it, it is on my hard-drive and I can make a copy.
 
Share this answer
 
Comments
Maciej Los 18-Nov-19 5:34am    
Short And To The Point!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900