Extracting raw images from PDF

Related: extracting a page(s) from PDF


Instead of low-quality screen-shotting a PDF to get the images, use PDFtk to extract the original high-resolution images from the PDF. Note: only raster images can be exported with PDFtk.

Examples

Examples of PDF image extraction tasks:

  1. List all PDF images
    pdfimages -list in.pdf
    
  2. Extract PDF images from all pages
    pdfimages -all in.pdf out
    

    That dumps all images in mydoc.pdf to the same directory. Filenames start with out-. There might be a lot of images.

  3. Extract PDF images from specific pages. This 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

Install PDFtk

How to install PDFtk on any operating system.

  • Linux: apt install poppler-utils
  • Windows

Mac PDFtk install

Follow the discussion at

https://stackoverflow.com/questions/20804441/how-to-install-pdftk-on-mac-os-x

Leave a Comment