Created
October 7, 2012 07:56
-
-
Save sasasin/3847479 to your computer and use it in GitHub Desktop.
ディレクトリに集めた画像ファイルを、PDFファイルに固めるスクリプトです。コミックや小説のため「右から左へ」のフラグをPDFに埋め込んでいます。
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/sh | |
export MAGICK_TEMPORARY_PATH=$HOME | |
find "$@" -type d | while read f; do | |
OUTDIR=$f | |
rm -f "$(pwd)"/"${OUTDIR}".pdf | |
echo "converting $f " | |
(jpg2pdf.pl \ | |
-d "$(pwd)"/"${OUTDIR}" \ | |
-o "$(pwd)"/"${OUTDIR}".pdf \ | |
-s "A4" -t "" -a "" \ | |
) \ | |
|| convert -limit memory 2gb -limit map 2gb \ | |
"$(pwd)"/"${OUTDIR}"/*.{jpg,JPG,jpeg,JPEG,png,PNG} \ | |
"$(pwd)"/"${OUTDIR}".pdf | |
run_pdfdirection.sh \ | |
"$(pwd)"/"${OUTDIR}".pdf \ | |
"$(pwd)"/"${OUTDIR}".R2L.pdf \ | |
"R2L" | |
mv "$(pwd)"/"${OUTDIR}".R2L.pdf \ | |
"$(pwd)"/"${OUTDIR}".pdf | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment