Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a pdf catalog that was given to me from a client in pdf format. They don't have the images but they're in the pdf.

Is there a way to extract all images from a pdf using a command line tool while preserving it's original file names?

I reviewed this thread ( Extract images from PDF with layer masks ) but this is for individual images.

share|improve this question
up vote 4 down vote accepted

The program pdfimages from the package poppler-utils might be what you are looking for. From the man page:

Pdfimages reads the PDF file PDF-file, scans one or more pages, and writes one PPM, PBM, or JPEG file for each image.

On newer versions of poppler-utils there is an all switch to extract to jpg or png:

pdfimages -all input.pdf images/prefix

will output files in the form prefix-nnn.[png|jpg] in the images folder.

share|improve this answer

VeryPDF PDF Extract Tool Command Line can be used to extract text and images from PDF file. You can get a test version from this webpage.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.