How-To: Remove a (known) password from a PDF file in Linux
r3dux | November 17, 2011I had a PDF the other day which required me to enter a password before viewing it, which is something I’d never seen before, so being a chancer I just slapped enter and it worked (i.e. there was no password, or more accurately the password was blank). However, keeping a file in that state is just stupid, so I wanted the “password” removed – and it turns out that it’s dead simple to do in Linux.
Two Stepper
- Install qpdf with synaptic or the command:
sudo apt-get install qpdf
- Issue the following command:
qpdf --password=YOURPASSWORD-HERE --decrypt INPUT-FILE.pdf OUTPUT-FILE.pdf
So, if your password protected pdf is called foo.pdf and the password is empty (i.e. “”) like in my case, you just issue something like this:
qpdf --password= --decrypt foo.pdf foo-no-password.pdf
Job done!
























