Created
September 21, 2014 14:03
-
-
Save innermond/d6cd1985124af8a782fd to your computer and use it in GitHub Desktop.
Extract a range o pages $2 - $3 from a PDF document $1 as PNG images prefixed with $4 - for quality the script saves images with high resolution and scales them down
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 | |
| tempdf=$(tempfile) | |
| gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER -dFirstPage=$2 -dLastPage=$3 -sOutputFile=$tempdf $1 | |
| gs -dNOPAUSE -sDEVICE=png16m -r600 -dDownScaleFactor=3 -dBATCH -dSAFER -sOutputFile="$4-$2-%00d.png" $tempdf | |
| rm -f $tempdf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment