-
-
Save jedwards1211/9ba64d08e46933bba231 to your computer and use it in GitHub Desktop.
script to PDF to JPG using pdftk and imagemagick
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/bash | |
# Script to convert PDF file to PNG images | |
# | |
# Dependencies: | |
# * ghostscript | |
for PDF in "$@" | |
do | |
echo "Processing $PDF..." | |
DIR=`basename "$PDF" .pdf` | |
mkdir "$DIR" | |
gs -dUseCropBox -dAutoRotatePages=/None -sDEVICE=png16m -o "$DIR"/%04d.png "$PDF" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment