I'm currently working on a PHP project where you can upload (through a simple file_get_contents) and edit a PDF. My current goal is to detect if the uploaded PDF is protected in any way (read only, encrypted, password protected) so I can reject it during the upload process.
I'm using TCPDI, but open to other suggestions (including parsing the whole string). I've also found a thread about using Ghostscript, but it seems that option isn't reliable :
is it possible to check if pdf is password protected using ghostscript?
Regards,