ghacks Technology News

Merge PDF Files

Winston was asking me if I would know a way to merge one or more pdf files so that the contents of all the files would appear in one pdf file at the end. A quick research revealed a software pdftk – pdf toolkit -which can be used to merge and split pdf files. Many shareware softwares exist that do the same thing but pdftk seems to be one of the few that can merge pdf files for free.

Pdftk runs from the command line which means you should unpack the software into a directory that you can access easily. I put the file into c: for testing purposes along with two pdfs called 123.pdf and 456.pdf.

If you run pdftk without parameters you get a quick output that details the most important parameters. Lets take a look at the possible operations:

Merge pdf files:

pdftk 123.pdf 456.pdf output 123456.pdf

This tells pdftk to merge the two pdf files 123.pdf and 456.pdf into a new pdf called 123456.pdf. If you want to merge more than two pdf files at once you simply add them between pdftk and output. You could also use wildcards to merge many or all pdfs with a certain name.

pdftk *.pdf output 123456.pdf

Split pages from one or more pdfs:

pdftk A=123.pdf B=456.pdf cat A1-2 B4-5 output 1245.pdf

Repair a pdf:

pdftk 123.pdf output 123fixed.pdf

Merge encrypted pdfs:

pdftk A=123.pdf 456.pdf input_pw A=password cat output 123456.pdf

Pdftk offers several more possibilities which are worth a look if you want to do something that I did not describe on this website. A version for Linux and Windows is available.

Read More:

Pdftk Homepage

Enjoyed the article?: Then sign-up for our free newsletter or RSS feed to kick off your day with the latest technology news and tips, or share the article with your friends and contacts on Facebook or Twitter.

Related Articles:

Split Or Merge PDF Files
Merge PDF Files With PDF Binder
Split and Merge PDF Documents
Merge, split, and watermark your PDFs with PDF Chain
How To Merge Mp3, Wav With Audacity



About the Author:Martin Brinkmann is a journalist from Germany who founded Ghacks Technology News Back in 2005. He is passionate about all things tech and knows the Internet and computers like the back of his hand. You can follow Martin on Facebook or Twitter.

Author: , Tuesday October 2, 2007 -
Tags:, , , , ,


Responses so far:

  1. R.Prabhu says:

    there is another open source software with a nice gui based on Java and work great too, here’s the link http://www.pdfsam.org/

  2. Koob says:

    Very Nice, thx

  3. vrybas says:

    That’s what i was looking for. Thx!
    Already downloading for Linux.

  4. Jim says:

    this is a great tool, works very well

  5. SigSingh says:

    Nice… tool, I tried it on my PC, but I’m mostly a Mac user. Since then, I found an easier program:

    Join PDF files

    Since I don’t have to join a lot of PDF files, I just use the free version…

  6. Scott says:

    I needed to assemble 900 PDF chapters into a single 6000 page PDF book, complete with bookmarks to each chapter. I wrote a shell script to do it:

    http://github.com/bronson/pdfdir

Leave a Reply   Follow Ghacks   Subscribe To Comment Rss

Subscribe without commenting

© 2005-2012 Ghacks.net. All Rights Reserved. Privacy Policy - About Us