Manage PDF Password - Removing password (looping through set of passwords)

We receive hundreds of PDFs per day and some of them have encryption passwords. I am loading a list of potential passwords and then running a “For Each File in Folder” activity which includes a Try Catch Activity containing the “ManagePDFPassword” activity. I have setup the TryCatch so that if the passwords don’t match the exception is handled and then an IF statement is run so that incorrect files are moved to a Reprocessing folder and good files are moved to a Decrypted folder. I then move all the failed files back into the folder at the end and recycle through with the next potential password.

This works perfect, however we also receive files that have no passwords. I have tried adding an empty field in my potential password dataset, however the activity is seeing this as an exception.

Does anyone know how I could handle files with no password? Is there a away of determining if a password is present without opening it?


I don’t really understand your query could you elaborate more?
I have tried the Manage PDF Password (UiPath.PDF.Activities 3.6.0) activity and when the pdf is not protected by password it did not throw any exception.

If in your case it does throw the exception I’d add a catch for the specific exception type to handle the cases which throw this exception.

There is no direct way to check if pdf is password protected or not in Official Activities as far as I know. You can check this thread it shows how to check if file is password protected with activities and code.
Skip PDF Files that are password protected - #4 by dokumentor

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.