Celeb Glow
updates | March 27, 2026

What is a quick way to connect two or more pdfs together using the command-line?

I have a few pdf files (e.g., small1.pdf, small2.pdf, small3.pdf) that I'd like to be able to join together to form one larger pdf (e.g., large.pdf).

  • What is a good option for doing this on the command-line?
4

2 Answers

I used pdftk for that:

sudo apt-get install pdftk

then:

pdftk small1.pdf small2.pdf small3.pdf cat output large.pdf
1

PDFJam and PDFtk can do this too, but since you probably have Ghostscript installed already (all one line):gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=large.pdf -f small1.pdf small2.pdf small3.pdf

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy