Click here to Skip to main content
15,883,883 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want to show a pdf file in iframe and i keep it(pdf file) password protected. So when the page is loaded then browser show a alert message "this document is password protected. please enter a password". So i want that user can open this document in browser only and if he will download that pdf file, he can not open that due to password protected. Can I solve this with jquery? the password is "123456"

Visit http://sitestudy.co.nf/iframe.html to show demo or http://fiddle.jshell.net/dTbjE/
Posted
Updated 8-Feb-14 23:40pm
v2
Comments
Showing PDF in iFrame directly won't work, I guess. You should search some methods to do it using the library or dll which you are using to make it protected.
Member 10582369 9-Feb-14 12:54pm    
thank you to reply, I will try that....
Gud. Let me add one answer for you so that you can accept that.

The behavior you see - asking PDFs password - is part of the browser and not some 'trick' added by the developer.
As long as your PDF is password protected, and you try to display it in the browser window - it (in fact the underlying application used to display the PDF) will as the password.
If the PDF downloaded without displaying it, the password will be required when the user will try to display it - in whatever application...
 
Share this answer
 
Comments
Member 10582369 9-Feb-14 13:11pm    
Thank u Peter to reply.
Actually I am working on a project and my client want to display contents in browser but want to protected like (user can only view after login). So I trying to show PDF but its simple to download now I gave it password so if user will download it they also will not able to open without to know password. So I want to control that browser alert, to automatically fill password when PDF file is going to load.

So if any solution for this situation plz reply......
Kornfeld Eliyahu Peter 9-Feb-14 13:42pm    
To clarify. You want:
1. Let the user download password protected PDF
2. If opened inside browser automatically provide password so logged-in user can see the PDF
Is that true?
Showing PDF in iFrame directly won't work, I guess.

You should search some methods to do it using the library or dll which you are using to make it protected.
 
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