Last active
March 8, 2017 16:21
-
-
Save DeanF/26e7aa81572fe148eff9726efb451189 to your computer and use it in GitHub Desktop.
Unlocks all pdfs in a folder using pdftk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for filename in *.pdf; do | |
pdftk $filename input_pw $1 output "$filename.tmp.pdf" | |
if [ $? -eq 0 ]; then | |
rm "$filename" | |
mv "$filename.tmp.pdf" "$filename" | |
touch "${filename}" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment