Created
August 19, 2013 23:10
-
-
Save vcarel/6275281 to your computer and use it in GitHub Desktop.
Shell script to generate a PDF file from a large amount of scanned pages.
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
cd pictures | |
FILES=$( find . -type f -name "*jpg" | sort -V ) | |
mkdir temp && cd temp | |
for file in $FILES; do | |
BASE=$(echo $file | sed 's/.jpg//g'); | |
convert ../$BASE.jpg $BASE.pdf; | |
done && | |
pdftk *pdf cat output ../FINAL_NAME.pdf && | |
cd .. | |
rm -rf temp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment