How to find out if any PDF file is encrypted or not

Certified Senior Developer

Hello

I have a requirement to read text from PDF so we have used getpdftext but if the user uploads password protected PDF file , the function getpdftext is throwing the below error-

Expression evaluation error at function 'getpdftext': Cannot decrypt PDF, the password is incorrect

If the file is password protected, I need to by pass the flow which is going to getpdftext, So Before only I need to check if the file is password protected or NOT. Can any one please suggest how to achieve this.

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to darrenr1624

    Thanks  for your input and time, function listed in Document Page Counter plugin works with Password protected pdf and returns 0.
    we are a bit hesitant of using plugins not listed by Appian (Author: Appian Corporation). we are planning to go ahead with a timer-based exception handling mechanism at the parent process level to route to an alternate path if an error occurs and the subprocess halts.

Children
No Data