Last active
January 15, 2020 16:26
-
-
Save tankxu/fd16311372980f125b709a582f5e5a23 to your computer and use it in GitHub Desktop.
Convert multi page pdf to a single jpg file
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 | |
# set -e | |
for file in ./pdf/* | |
do | |
fileName=$(basename -- "$file") | |
fileName="${fileName%.*}" | |
# echo $filename | |
pdfName=./pdf/$fileName.pdf | |
outputName=./jpg/$fileName.jpg | |
convert -density 150 $pdfName ./output.jpg && convert -append output-*.jpg $outputName && rm output-*.jpg | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment