Skip to content

Instantly share code, notes, and snippets.

@adamatan
Created January 3, 2022 16:19
Show Gist options
  • Select an option

  • Save adamatan/243027a53b1c19ba639d43db8ca01f06 to your computer and use it in GitHub Desktop.

Select an option

Save adamatan/243027a53b1c19ba639d43db8ca01f06 to your computer and use it in GitHub Desktop.

Revisions

  1. adamatan created this gist Jan 3, 2022.
    9 changes: 9 additions & 0 deletions decrypt_pdf.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    #!/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/%