Debian Admin

Debian/Ubuntu Linux System Administration Tutorials,Howtos,Tips

  • RSS Subscribe

    subscribe to the Debian Admin RSS feed
  • Sponsors



  • Categories

  • Sponsors

  • Support DebianAdmin

    Amount $:
    Website(Optional):


  • Meta

  • Archives



Combine multiple PDFs into one file in Ubuntu Linux

Posted by Admin on January 5th, 2007

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

It is very useful to combine multiple PDF documents into one file. This is useful especially if you accumulate many PDFs (newsletters, bills, etc.) over time.

Preparing Your system

sudo apt-get install gs pdftk

Now we will see one example how to combine pdf files let us assume we have 1.pdf,2.pdf,3.pdf files and now we need to cobmine this files using the following command

gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=combinedpdf.pdf -dBATCH 1.pdf 2.pdf 3.pdf

In the above command after “-sOUTPUTFILE=” type whatever name you want for the merged file (don’t forget to append .pdf to the end of the file name). Rename “1.pdf 2.pdf 3.pdf” to whatever your file names are (separate your file names with a space).

After you run the above command, a new PDF file called combinedpdf.pdf will be created with your individual files merged according to the order you list.

If you want to know more options available for gs command check man page

  • Share/Bookmark

7 Responses to “Combine multiple PDFs into one file in Ubuntu Linux”

  1. versuchsanstalt Says:

    Will the appended files be preceded by a pagebreak?

  2. blah Says:

    weiß ich leider nicht, müsstest du mal den author fragen

  3. george m Says:

    I’m a new ubuntu user. It’s dissapointing that none of the PDF gui programs in the list have this feature.

  4. Rick van der Zwet Says:

    Works like a sharm, thanks!

  5. allen Says:

    Excellent! thanks so much!

  6. Lasse Says:

    Perfect!….just perfect. It even compresses the files a bit. Suited me just fine. Thx.

  7. pem Says:

    pdftk a.pdf b.pdf c.pdf cat output abc.pdf

    this command is easier to remember.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>