Created
August 8, 2012 04:55
-
-
Save FUKUZAWA-Tadashi/3292195 to your computer and use it in GitHub Desktop.
convert PDF file (scanned by ScanSnap 1500 monochrome super fine mode) to CBZ suitable for Rakuten KOBO. need GraphicsMagick and ghostscript
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 | |
fb=`basename "$1" .pdf` | |
if [ ! -f "$fb.pdf" ]; then | |
echo "$fb.pdf not found" | |
exit 1 | |
fi | |
mkdir "$fb" | |
gm convert -verbose -density 300x300 -trim -bordercolor white -border 10x10 -resize 600x800 -quality 90 +adjoin "$fb.pdf" "$fb/%04d.jpg" | |
zip "$fb.cbz" "$fb"/*.jpg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment