A PDF processor written in Go.

View the Project on GitHub pdfcpu/pdfcpu



Merge 2 or more PDF files into outFile. Have a look at some examples.


pdfcpu merge [-m(ode) create|append] [-sort] outFile inFile...


name description default required
m(ode) create, append create no
sort sort inFiles if present unsorted no

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
outFile PDF output file yes
inFile… at least 2 PDF input files subject to concatenation yes


The following PDF elements are not carried over into the merged document:


pdfcpu respects the order of the provided input files and merges accordingly. Merge three input files into out.pdf by concatenating in3.pdf to in2.pdf and the result to in1.pdf:

pdfcpu merge out.pdf in1.pdf in2.pdf in3.pdf

Merge all PDF Files in the current directory into out.pdf:

pdfcpu merge out.pdf *.pdf

Merge some PDF files into an existing PDF file out.pdf:

pdfcpu merge -mode append out.pdf in1.pdf in2.pdf in3.pdf