Created
June 2, 2013 11:40
-
-
Save higemaru/5693391 to your computer and use it in GitHub Desktop.
* jpg2pdf
* jpg dirname = pdf filename = pdf meta title
* Sony Reader resolution = 584 x 754
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 | |
_DIR="$1"; | |
_NAME=`basename $_{DIR}` | |
_OIFS=${IFS} | |
IFS=" | |
" | |
cd "$_{DIR}"; | |
for file in `ls|perl -MSort::Naturally -e 'print nsort <>'`;do | |
convert -density 72x72 -resize x754 $file $(printf %04d $i).jpg | |
rm $file; | |
done; | |
convert *.jpg dummy.pdf | |
echo "InfoKey: Title | |
InfoValue: ${_NAME}" > dummy.info | |
pdftk dummy.pdf update_info_utf8 dummy.info output "${_NAME}.pdf" | |
rm dummy.info dummy.pdf | |
IFS=${_OIFS} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment