Image Fetching from PDF

../_images/pdf_icon.png

Usually I extract pictures from PDF documents by using Gimp: Whenever you open a PDF document, it’s asking you which pages it shall open. Basically all pages are opened as a graphic, so you can cut out all the graphics you want. But: Isn’t there a faster way to do this?

Yes, there is. The almighty command line provides you with a tool called pdfimages which focuses exactly on that purpose.

Instead using gimp I used

$ pdfimages -j -f 148 -l 148 file.pdf image

and extracted the graphics from page 148 (-f) to page 148 (-l) as jpg (-j) from file.pdf and all images were named image-00*.jpg. pdfimages just has seven parameter, so it’s pretty easy to learn. For those GUI-Lovers you can just put it into a script and run it via mouse-click then (but that kills all the fun, I think).