Created
October 18, 2010 09:12
-
-
Save upsilon/631946 to your computer and use it in GitHub Desktop.
情報処理技術者試験の過去問PDFをCBZに変換するスクリプト
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 | |
CONVOPT='-verbose -depth 8 -rotate -90 -resize 1024x600' | |
TMPDIR=`mktemp -d` | |
echo 'Extracting images...' | |
pdfimages $1 $TMPDIR/img | |
echo 'Converting PBM/PPM to PNG...' | |
for file in $TMPDIR/* | |
do | |
echo ' converting: ' $file | |
convert $CONVOPT $file $file.png | |
rm $file | |
done | |
echo 'Compressing images...' | |
name=`basename $1 .pdf` | |
zip $name.cbz $TMPDIR/* | |
echo 'Deleting temporaly files...' | |
rm -rf $TMPDIR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
情報処理技術者試験の過去問題をNetWalkerにそれっぽく表示させてみた - kim_upsilonの日記:
http://d.hatena.ne.jp/kim_upsilon/20101018/1287396158