A PDF processor written in Go.

View the Project on GitHub pdfcpu/pdfcpu



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.


pdfcpu split [-m(ode) span|bookmark|page] inFile outDir [span|pageNr...]


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  
u(nit) display unit po(ints),in(ches),cm,mm
c(onf) config dir $path, disable
upw user password  
opw owner password  


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


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


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