Manipulating PDFs from the Unix Command Line

The Poppler utilities provide many Unix command-line tools for manipulating PDFs. Install via:

  • sudo apt-get install poppler-utils (Ubuntu)
  • sudo apk add poppler-utils (Alpine)
  • brew install poppler (macOS)

Extract Text from a PDF

1
pdftotext input.pdf output.txt

Merge PDFs Together

1
pdfunite file1.pdf file2.pdf merged.pdf

Split (Extract) Pages from a PDF

This will split each page of input.pdf to output_1.pdf, output_2.pdf, etc.

1
pdfseparate input.pdf output_%d.pdf

Manipulating PDFs from the Unix Command Line
https://jifengwu2k.github.io/2025/08/27/Manipulating-PDFs-from-the-Unix-Command-Line/
Author
Jifeng Wu
Posted on
August 27, 2025
Licensed under