Hardcore Linux

Anything about Ubuntu, Centos, openSuSe and Fedora

Combining PDF Files

In MS and OSX it is easy to combine several PDF files into one file, using Adobe Acrobat,an application that’s currently absent in Linux systems, but there are number of programs that can cope up to this sort comings. One of them is ghostscript.

Joining PDFs using Ghostscript.

Ghostscript is a package that enables you to view or print PostScript and PDF files to other formats, or to convert those files to other formats. It’s a popular tool among Linux users, but what many people don’t know is that Ghostscript is also a powerful tool for combining PDF files.

To use Ghostscript to combine PDF files, type something like the following:

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

Unless you’re very familiar with Ghostscript, that string of commands won’t mean much to you. Here’s a quick breakdown:

  • 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=finished.pdf — tells Ghostscript to save the combined PDF file with the name that you specified

Source: http://www.linux.com/feature/36815


One response to “Combining PDF Files

  1. How I Shed T h i r t y P o u n d s in Under a Month May 6, 2009 at 4:33 am

    Hi, interesting post. I have been thinking about this topic,so thanks for writing. I’ll likely be subscribing to your site. Keep up the good posts

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: