How to Extract Specific Pages from a PDF in Linux Terminal Using pdfseparate

Working with large PDF documents—such as digital manuals, academic journals, contracts, or scanned financial records—frequently requires isolating specific sections or extracting individual pages for distribution. While graphical desktop suites like LibreOffice Draw or web-based converter portals can manipulate PDFs, they introduce unnecessary overhead, potential privacy risks when uploading confidential documents, and sluggish performance when handling files hundreds of pages long.

For fast, scriptable, and offline page extraction, Linux systems provide pdfseparate. Part of the industry-standard poppler-utils collection, pdfseparate extracts individual pages or defined page ranges directly from the command line in fractions of a second without re-rendering or compromising original document formatting. This guide covers installing poppler-utils across major distributions, basic single-page extraction syntax, extracting bounded ranges, and batch-processing documents with shell loops.

Installing poppler-utils on Linux

Because pdfseparate is packaged within the core Poppler rendering library utilities, it is readily available across all major Linux package managers:

  • Ubuntu, Debian, and Linux Mint:
    sudo apt update && sudo apt install poppler-utils
  • Fedora, RHEL, and CentOS Stream:
    sudo dnf install poppler-utils
  • Arch Linux and Manjaro:
    sudo pacman -S poppler
  • openSUSE:
    sudo zypper install poppler-tools

The Basic Syntax: Understanding Page Placeholders

The standard syntax for pdfseparate requires an input PDF file and an output naming pattern:

pdfseparate [options] input.pdf output_pattern.pdf

Because pdfseparate extracts pages as individual PDF files, your output filename must contain a format specifier (such as %d) that represents the page number. If you fail to include %d, pdfseparate will return an error reminding you to specify a page placeholder.

For example, to split every page of a document named annual_report.pdf into separate files:

pdfseparate annual_report.pdf report_page_%d.pdf

This generates files named report_page_1.pdf, report_page_2.pdf, and so on.

Extracting a Defined Page Range

In most practical scenarios, you do not want to extract every single page; you only need a specific section. You can specify start and end boundaries using the -f (first page) and -l (last page) flags.

To extract pages 5 through 10 from manual.pdf:

pdfseparate -f 5 -l 10 manual.pdf chapter1_page_%d.pdf

This creates exactly six standalone files: chapter1_page_5.pdf through chapter1_page_10.pdf.

Extracting a Single Target Page

If you only need one specific page (such as page 4 containing a signed signature sheet), set both -f and -l to the same page number:

pdfseparate -f 4 -l 4 contract.pdf signed_page_%d.pdf

You can then rename the resulting file or direct the output directly into a specific archival directory:

pdfseparate -f 4 -l 4 contract.pdf /home/user/documents/signature_page.pdf

(Note: When extracting exactly one page, you can use a fixed filename without %d).

Recombining Extracted Pages with pdfunite

A frequent companion tool in the poppler-utils suite is pdfunite. If you extract several non-consecutive pages or sections and want to merge them into a single consolidated document, you can pipe or combine them effortlessly:

pdfunite chapter1_page_5.pdf chapter1_page_6.pdf chapter1_page_7.pdf merged_summary.pdf

Using pdfseparate in your Linux terminal workflow provides a lightning-fast, private, and dependable method for handling PDF pagination without ever relying on cumbersome third-party software.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.