Skip to content

Instantly share code, notes, and snippets.

@okvv
Last active July 10, 2023 11:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save okvv/56e4c5f1f72ccd664733bbf429ddd1a2 to your computer and use it in GitHub Desktop.
Save okvv/56e4c5f1f72ccd664733bbf429ddd1a2 to your computer and use it in GitHub Desktop.
bash script to bulk remove password from (pdf) files in current directory using qpdf
#!/usr/bin/env bash
for f in *
do qpdf --password=THE_PASSWORD --decrypt --replace-input $f;
done
# brew install qpdf
# for executable file run: chmod u+x decrypt-pdf.sh
# merge files into one PDF: `qpdf --empty --pages *.pdf -- out.pdf`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment