Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
1.67/5 (2 votes)
How to open Pdf in browser in asp.net but don't want user can copy / download the pdf or How we can disable right click in pdf viewer in browser
Posted
Comments
Krunal Rohit 30-Oct-15 7:03am    
oncontextmenu = return false;

-KR
Nathan Minier 30-Oct-15 7:29am    
You can't disable the pdf viewer functionality in all browsers. The reason is that pdf files are often opened by plugins which take control of the data, and the browser has nothing to do with the view execution at that point.
PJ003 30-Oct-15 9:06am    
Try using third part tools like Print2Flash which converts the document to swf format which provides many such options like restricting download.

1 solution

If you don't want someone to have a file then don't put it on the internet.

If you want to secure your PDF you'll need to use one of the various mechanisms built in to the PDF creator\readers.

http://www.techradar.com/news/world-of-tech/roundup/software/applications/how-to-create-secure-documents-with-pdfs-1085832[^]
 
Share this answer
 

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