I used this and this to check a PDF file is password protected or not! i test this methods:
exec("$shFunction withPassword.pdf",$result);
OR
shell_exec('sh ' . $shFunction . ' withPassword.pdf');
- i set ghostscript in $shFunction
- password.pdf and php file are in same folder
but i get error:
Failed to invoke gs