Copy link to clipboard
The requirement is to display a password-protected PDF in the browser but to pass the User password programmatically.
I am using the MERN stack and used ADOBE API Tool to create and protect PDF. I want to know can I display this PDF within a webpage (using iframe or any other solution) without the user needing to input the password manually.
The moto here is to - while displaying in the browser, the user should not be prompted to key in the password and hence the password should be supplied by the application, However, if the user downloads the PDF and then tries to open it, he should be prompted to enter the password.
Copy link to clipboard
What exactly are you trying to achieve? If the goal is to seamlessly display a PDF file in a browser but prevent the user from downloading it, or more correctly, prevent the user from opening the file after downloading it, you don't need to password protect the file. Instead, you can use Adobe Embed API to display the PDF in the browser and configure it to prevent download. You can see an example at this CodePen.
If this was not your goal, please elaborate on your original message.
I looked at the code on this CodePen. But here the PDF still publicly available via a direct URL link in the .js file.
My aim is to protect the information inside of PDF and only allow the logged-in user to view the PDF. However, if the logged-in user downloads the PDF they should not be able to open it (because of unavailability of password).
I am developing a website where only logged-in users can view the PDF and read the information within it. Since the website will be delivered via a web browser the normal (unprotected) PDF would not be able to secure the information and prevent duplication of PDF.
I require a solution where a protected PDF is delivered to the user's browser and unlock itself on the local machine. Even if downloaded, should require a password to open.
Right. That was just my example. You can easily obfuscate the PDF url by having your server convert the PDF to base64 and then using that as your content property. I have an example of that as well if you are interested. Essentially as long as the content is passed as a Promise that resolves as a ByteArray, you can show the PDF.
Yes, this helped sorry I didn't read the comments.