3

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?
  • Couturier is a GUI way I know of doing this, but AFAIK it is no longer maintained since 9.04, and I don't know of an equivalent terminal command myself. – Christopher Kyle Horton Aug 8 '11 at 3:47
  • Sorry, I just realised I've probably created an almost duplicate question. I just saw the following answer in the "related question" area suggesting the use of pdftk in the above case: askubuntu.com/questions/2799/how-to-merge-several-pdf-files/… – Jeromy Anglim Aug 8 '11 at 3:48
  • I would suggest closing this question then, unless that doesn't work out for you. At any rate, glad to know you've found a possible solution. – Christopher Kyle Horton Aug 8 '11 at 3:51
  • @Warrioring64 With regards to closing, I don't mind either way. The other question asked about merging pdfs in general (including the use of GUIs) whereas this question is specifically focused on command-line options. Perhaps this question will reveal some other useful answers. – Jeromy Anglim Aug 8 '11 at 6:19
10

I used pdftk for that:

sudo apt-get install pdftk

then:

pdftk small1.pdf small2.pdf small3.pdf cat output large.pdf
  • 1
    +1 If you are planning on working with PDFs on the command line pdftk should be in your toolbox. – Richard Holloway Aug 8 '11 at 22:30
4

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

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.