Skip to content

Instantly share code, notes, and snippets.

@adamatan
Created January 3, 2022 16:19
Show Gist options
  • Save adamatan/243027a53b1c19ba639d43db8ca01f06 to your computer and use it in GitHub Desktop.
Save adamatan/243027a53b1c19ba639d43db8ca01f06 to your computer and use it in GitHub Desktop.
PDF in the CLI
#!/bin/bash
# Usage:
# PASSWORD='MY-SECRET-PASSWORD' ./decrypt_pdf.sh
mkdir -p decrypted
find . -type f -maxdepth 1 -name '*.pdf' -print0 | \
xargs -0 -n 1 -I % \
qpdf --decrypt --password=${PASSWORD} % decrypted/%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment