Is there a way to test if a PDF is password protected without prompting the user?
I would like to create a remove password function that would check if a PDF is password protected, and if it is, ask the user if they would like to remove the password.
It would work something like.
Open the PDF in the Viewer, you currently prompt the user for a password to open if it has a password. As you designed it, if the user enters the correct password, it opens the PDF.
After the PDF is opened, check if there is a password set for the PDF.
If there is, ask the user if they want to remove the password.
If user responds yes, create a new PDF without encryption or passwords, and import each page from password protected PDF.
Save New PDF.
