Bulk Export Images to JPG from PDF - bash one liner

Sometimes I forget what power there is in free software. I put this quickie together the other day. Just be aware that it won’t handle any spaces in the PDF filename.

for i in *.pdf;do pdfimages $i ${i%.*};done && for i in *.ppm;do ppmtojpeg $i >> ${i%.*}.jpg;done; rm -f *.ppm

images are exported as -00n.jpg - ie: the n’th image found in the pdf.


About this entry