Bulk Export Images to JPG from PDF – bash one liner
19 October 2008
2 Comments
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








it took me a while to figure out, but to handle spaces in filenames for that kind of bash-loop, you quote the second argument, it does not work with backtic args like: for i in `ls *gif`;
for i in *.pdf; do pdfimages “$i” ; done
Wow – thanks for this! Exactly what I was looking for. I seemed to remember there being an export image function in Acrobat but couldn’t find it… Any way to have the images exported with a white background? (mine all had black ones).
Nadine
Leave your response!
Recent Posts
Tags
Archives
Automotive / Transportation
Blogroll
Technology
Travel