NOGDUS $1670.00 has been donated to NOGDUS!
September 20, 2017, 08:21:47 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
   Home   Help Search Login Register  
Pages: [1]   Go Down
Author Topic: Merging PDF files  (Read 3399 times)
0 Members and 1 Guest are viewing this topic.
Richard Marks
Offline Offline

Respect: 3425
« on: May 16, 2009, 03:00:59 AM »

This is very easy to do on Linux.

Lets say that the directory ~/pdfs/book/chapters/ contains a lot of PDF files (one for each chapter) and we want to create book.pdf that contains all the chapters in one.

We need to have the gs and pdftk packages installed.
$ sudo apt-get install gs pdftk

Now that we have the tools, lets make our pdf with one command!

Change into our working directory
$ cd ~/pdfs/book/chapters

And create our pdf
$ ls *.pdf | xargs gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=book.pdf -dBATCH

That's it. After a few minutes (or longer if you have many pdfs to merge) you will have a shiny new book.pdf containing all the other pdf files.

Tip: name the pdf files using numerical prefixes so that they merge in order.

Pages: [1]   Go Up
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
.: Theme by Richard Marks :.
Valid XHTML 1.0! Valid CSS!