How to remove a pdf password

broken image

In Windows, I think it would be Ctrl+ z, but I'm not sure). You can then type, RET and Ctrl+ d ( Ctrl+ d sends EOF in Linux. Once you enter that, qpdf will be waiting for input from stdin. qpdf can read a password from stdin passing - to the -password-file= option: qpdf -password-file=-decrypt protected.pdf out.pdf The password is then queried in the terminal and you can type it. With pdftk we can use: pdftk protected.pdf input_pw output out.pdf do_ask But maybe you received a pdf from a company which used some data of yours to encrypt the file, and you'd like to avoid leaking it. Of course, since this is about removing the password protection from the file, maybe you don't care. This is an old question, but seems to be a reference on the matter and, surprisingly, none of the answers tells us how to avoid passing the password on the command line (which may be a source of leakage).

broken image