How to open Protected pdf without password in web app?
when i open password protected pdf file in my application,it should not ask password.when i download that pdf from application show password popup and should be enter by the user . How to implement this type of senario using asp.net mvc
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Dorababu MekaRank #457 · 5.5K reputationPosted Jul 27, 2018, 2:20 AM EDT
Amin Dodin177 reputationPosted Aug 2, 2018, 12:16 PM EDT
If you mean neither you nor the user know the password, then opening such a file is not easy (or even not possible).
But if you know the password (for example you have it stored in DB) and you don't want a popup asking the user to enter it, you can use code to supply the password and open the PDF without such a popup.
One way to do that is to use the LEADTOOLS imaging toolkit to open the PDF file. If you're using C# at the server side, the code to provide password and open PDF looks like this: