In this short tip, i will show you how to extract images from pdf documents using pdfimages which is a command line tool designed to rip images from PDFs.

First, make sure you have installed the required package:

sudo apt-get install poppler-utils

To extract images from a PDF document called MyPdf.pdf, do the following:

pdfimages -j MyPdf.pdf image-basename

As you can see in the example above, the syntax is very straightforward. However, if you want to limit the extraction to an interval of pages (Ex. 3-9), run the following command:

pdfimages -j -f 3 -l 9 MyPdf.pdf image-basename

Comments