Oct 25

Combining two or more PDFs into one, on Linux

Category: Linux   — Published by tengo on October 25, 2010 at 4:38 pm

The most elegant, open-source and completely free solution: use ghostscript.

$ gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=finished.pdf inputfile1.pdf inputfile2.pdf

ghostscript (gs) is pre-installed on most Linux distributions.

Note:
Learn about Merging multiple pdf files and jpg files into one PDF in this related post where files of different types (JPGs and PDFs) are merged into one PDF.

On Windows:
If you're on Microsoft Windows, have a look at pdftk, which I found via this discussion.

Related

Merging multiple pdf files and jpg files into one PDF
Extract images from PDF files
Convert images to PDF document, on Linux, on CLI