More precisely: Given a folder containing images in pdf-format (each of which has a name of the form NAME.pdf, with NAME being composed of several words separated by spaces), how do I batch convert the images to jpg-format and preserve their names in the form NAME.jpg ? (Using pdftoppm as indicated in "How to convert a .pdf file into a folder of images?" seems rather complicated, since it requires treating each image separately.)
Asked
Active
Viewed 682 times
1 Answers
3
You can use convert
from imagemagick
to convert a PDF into an image.
To install it, use the following command:
sudo apt-get install imagemagick
To convert all PDFs in a directory, go to that directory and run the following command:
for i in *.pdf; do convert "$i" "${i%.*}.jpg"; done
-
That will not work for files with spaces in the name ("NAME being composed of several words separated by spaces). You have to quote the variables. – Panther Oct 01 '13 at 19:57
-
I've edited the answer to reflect this. – SirCharlo Oct 01 '13 at 20:20