Today I learned about pdftoppm, a simple CLI tool that can convert each page of a PDF into separate image files.

My use case was to chop up a few big PDF reports to make OCR and data analysis easier, but scanning them a page at a time.

Install

I’m using Homebrew on macOS, but Poppler will also run on Linux and other operating systems.

$ brew install poppler

Quick Usage

$ pdftoppm -png -rx 300 -ry 300 input.pdf output
  • -png -> save the output files as PNG images
  • -rx 300 -ry 300 -> set the output resolution to 300 dpi
  • input.pdf -> your source file which you want to process
  • output -> Your output file prefix which will produce output-1.png, output-2.png, …