Hello, I would like to ask if it's possible to use PHP in removing a password from a password-protected PDF file in which I already know the password? I've seen this page which provides many options but using bash script. :( I was required to use PHP as much as possible. Any suggestions appreciated!
+1
A:
Of course it's possible, all you need to do is reverse engineer the encryption and compression and implement the reverse operations in PHP - but why bother:
<?php
`gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=unencrypted.pdf -c .setpdfwrite -f encrypted.pdf`;
?>
C.
symcbean
2010-06-01 15:36:26
i like you answer :D
RobertPitt
2010-06-01 15:38:14
Hi! Thanks for the reply. Yeah, I found this also on the link I posted above. I was getting the same error as this http://www.cyberciti.biz/faq/removing-password-from-pdf-on-linux/#comment-47555 though.
dsdeiz
2010-06-01 16:17:01