Removing (known) passwords from PDFs

Jun 23, 2021 10:08



It's a breeze, using qpdf:

$ qpdf --verbose --decrypt --password=PASSWORD encrypted_file.pdf decrypted_file.pdf
qpdf: wrote file decrypted_file.pdf
$

To decrypt several files at once, you can use your shell's facilities:

$ for i in *.pdf; do qpdf --verbose --decrypt --password=PASSWORD ${i} ${i/.pdf/_decrypted.pdf} ; done
qpdf: wrote file secrets_decrypted.pdf
qpdf: wrote file shhh_moresecrets_decrypted.pdf
$

If you don't like command line tools, you can also use PDFsam - the Basic edition is FOSS, available under the GNU Affero GPL.

useful stuff, software, pdf

Previous post Next post
Up