NOGDUS $1670.00 has been donated to NOGDUS!
September 23, 2017, 12:40:17 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Merging PDF files  (Read 3401 times)
0 Members and 1 Guest are viewing this topic.
Richard Marks
Administrator
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.
Code:
$ sudo apt-get install gs pdftk

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

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

And create our pdf
Code:
$ 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.
 Cool
Logged

Tags:
Pages: [1]   Go Up
  Print  
 
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!