2

Once I upload a protected PDF with password through a PHP page, I need to remove the password (stored in hardcoded way) with some PHP function and then save the current unprotected PDF file in the server's filesystem. Do you know any method / library to do it?

Thank you Fabrizio

Fabrizio A
  • 3,072
  • 5
  • 24
  • 35

1 Answers1

0

Maybe you can use gs to remove password. Try:

exec("gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=unencrypted.pdf -c .setpdfwrite -f encrypted.pdf");