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 [-m(ode) span|bookmark|page] inFile outDir [span|pageNr...]


Flags

name required value description
m(ode) no span Split into PDF files with span pages each (default).
    bookmark Split into PDF files representing sections defined by existing bookmarks.
    page Split before specific page number(s).


Common Flags

name description values
v(erbose) turn on logging  
vv verbose logging  
q(uiet) quiet mode  
-o(ffline) disable http traffic  
c(onf) config dir $path, disable
opw owner password  
upw user password  
u(nit) display unit po(ints),in(ches),cm,mm


Arguments

name description required default
inFile PDF input file yes  
outDir output directory yes  
span split span in pages no 1


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 -m bookmark test.pdf out


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

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