Extracting raw images from PDF

Use Poppler Utils to extract the original high-resolution images from the PDF. Poppler Utils are command line tools and part of the Poppler library.

This method generally yields much better quality images than screenshots of the PDF pages. The “pdfimages” command exports raster images, and “pdftocairo” exports vector graphics.

In these examples, “in.pdf” is the original PDF file.

Export raster PDF images

List all PDF images using pdfimages

pdfimages -list in.pdf

Extract PDF images from all pages, dumping all images in mydoc.pdf to the same directory. Filenames start with out-. There might be a lot of images.

pdfimages -all in.pdf out

Extract PDF images from specific pages: example is for page 3 only:

pdfimages -all -f 3 -l 3 in.pdf out
-f
first page to extract
-l
last page to extract

Export vector PDF images

Export vector PDF page(s) to SVG format using pdftocairo. Here we assume page 3 of the PDF has the vector images of interest.

pdftocairo -svg -f 3 -l 3 in.pdf out.svg

Use an SVG editor like Inkscape to isolate the image from the rest of the pages.

Install Poppler Utils

  • Linux: apt install poppler-utils
  • macOS / Linux (Homebrew): brew install poppler
  • Windows: use WSL poppler

Related: extracting a page(s) from PDF