Determine if a PDF file is Password protected

Hello,

Is there a way to determine via Powershell if a particular pdf file (among many files) is password protected (either on open or editing, printing) before I even open the file?

Thanks,

Bernard

September 11th, 2015 10:06am

YOu need to post this kind of issue in the Adobe forum.  It requires their SDK/API to doo.
Free Windows Admin Tool Kit Click here and download it now
September 11th, 2015 10:55am

Is there a way to determine via Powershell if a particular pdf file (among many files) is password protected (either on open or editing, printing) before I even open the file?

The short answer: Yes, there is(!)
The longer answer: You would need to read the file into an array of bytes, then examine the first 80 bytes. If the file is encrypted then the file header appears to contain this string:
obj<</Length 6 0 R/Filter /FlateDecode>>stream

You would need to confirm in an Adobe forum if this is a reliable encryption indicator.

September 11th, 2015 11:17am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics