Convert pdf files to jpg

I have made a simple script that converts a directory of pdf files into a directory of jpg files. I use it very often because every pdf client’s start is terribly long, and the view of large files is better with a jpg image than a pdf file with a tif inside.
I use pdfimages and convert to do the trick, and it’s quite fast (enough to be useful for my purpouses).

directory=`date +%x | tr "/" "-"`
mkdir $directory

if [ $? == 0 ]; then

# wget -m -np -nd
for articolo in `ls -1 *.pdf`
pdfimages $articolo $articolo
convert $articolo-000.pbm -scale 40% -negate -quality 30 $directory/$articolo.jpg
rm *.pbm
# album rassegna -index index -medium 800x600
exit 0

Convert pdf files to jpg
Torna su