Created
October 4, 2018 02:34
-
-
Save smowtion/eb058461b00d8896cd61cde7d6c3ef7e to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| SAVEIFS=$IFS | |
| IFS=$(echo -en "\n\b") | |
| pdftk_path="/usr/local/bin/pdftk" # full path to pdftk binary | |
| pdf_infokeys="~/pdf-infokeys" # full path to file containing new metadata | |
| pdf_search_path="/var/www/html" # path to search for pdf files | |
| pdf_temp_path="/tmp" # temporary directory | |
| for i in $( find $pdf_search_path -type f -name "*.pdf" ); do | |
| cp $i $pdf_temp_path/temp.pdf | |
| $pdftk_path $pdf_temp_path/temp.pdf update_info $pdf_infokeys output $i | |
| rm $pdf_temp_path/temp.pdf | |
| done | |
| IFS=$SAVEIFS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment