PDA

View Full Version : HOWTO :: Combine Multiple PDFs


royong
17-06-2009, 16:29
There are times when you need to combine multiple files from different sources into a single PDF file. On a Linux machine, I use the Ghostscript method

gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=combined.pdf file1.pdf file2.pdf

The following provides a quick breakdown of the commands and switches.

* gs -- starts the Ghostscript program

* -dBATCH -- once Ghostscript processes the PDF files, it should exit. If you don't include this option, Ghostscript will just keep running

* -dNOPAUSE -- forces Ghostscript to process each page without pausing for user interaction

* -q -- stops Ghostscript from displaying messages while it works

* -sDEVICE=pdfwrite -- tells Ghostscript to use its built-in PDF writer to process the files

* -sOutputFile=combined.pdf -- tells Ghostscript to save the combined PDF file with the name that you specified


On my system, the Ghostscript is provided by

[root@x61 /]# rpm -qf /usr/bin/gs
ghostscript-8.64-6.fc11.i586


Hope this helps.