Moritz Sackmann
  • Home
  • Impressum
  • Categories
  • Tags
  • Archives

Decrypt all PDF documents in one folder

From some classes in university, I get a bunch of encrypted pdf files for each lecture. Its really annoying to type in the password of those files every time I want to open them, so here is a trick to remove the password protection from all files. You should have qpdf installed for this to work.

mkdir decr
for f in *.pdf; do qpdf --password=FOOBAR --decrypt $f decr/$f; done

Replace FOOBAR by the password. All decrypted pdf files should now be in the folder decr. If that worked, you can overwrite the encrypted pdf files and remove the folder afterwards:

mv decr/* .
rm -rf decr

Published

Sep 18, 2016

Category

Computer

Tags

  • Computer 8
  • Linux 4
  • Powered by Pelican. Theme: Elegant by Talha Mansoor