4

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
  • 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. Aug 8, 2011 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/… Aug 8, 2011 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. Aug 8, 2011 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. Aug 8, 2011 at 6:19

2 Answers 2

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
    +1 If you are planning on working with PDFs on the command line pdftk should be in your toolbox. Aug 8, 2011 at 22:30
5

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .