Skip to content

Instantly share code, notes, and snippets.

@mike623
Created March 24, 2020 09:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mike623/7884f87032b505b5fa0acbb2211aca4b to your computer and use it in GitHub Desktop.
Save mike623/7884f87032b505b5fa0acbb2211aca4b to your computer and use it in GitHub Desktop.
#!/bin/bash
# unprotect multiple pdf files in a directory with qpdf 10Jan20
# run the script from the same directory as the files
if [ -d output ];
then
echo "output directory exists"
else
mkdir output
fi
yourfilenames=`ls *.pdf`
#echo yourfilenames
for eachfile in $yourfilenames
do
echo $eachfile
qpdf --decrypt $@ $eachfile output/$eachfile
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment