pdfcpu

Logo

A PDF processor written in Go.

View the Project on GitHub pdfcpu/pdfcpu


Changelog

Split

Generate a set of PDF files for inFile in outDir according to given span value. Also check out the extract pages command which gives you similar functionality. Have a look at some examples.

Usage

pdfcpu split inFile outDir [ span | pageNr... ] [flags]

Flags

namerequiredvaluedescription
m(ode)nospanSplit into PDF files with span pages each (default).
bookmarkSplit into PDF files representing sections defined by existing bookmarks.
pageSplit before specific page number(s).

Common Flags


Arguments

namedescriptionrequireddefault
inFilePDF input fileyes
outDiroutput directoryyes
spansplit span in pagesno1

Restrictions

The following PDF elements are not carried over into the output files:


Examples

Split a PDF file into single page PDF files in out:

$ pdfcpu split test.pdf out

Split a PDF file into individual PDF files for every sheet of paper. Every PDF output file in out spans 2 pages of the original:

$ pdfcpu split test.pdf out 2

Split a PDF file along its bookmarks:

$ pdfcpu split test.pdf out -m bookmark

Split a PDF file before pages 2,4,10:

$ pdfcpu split -m page test.pdf out 2 4 10