Merging PDF documents in linux

Recently I had a dillemma of sorts. I had a document that had printed to pdf…. each page to it’s own pdf. I didnt’ have time to spend figuring out how to make the document print to one multi-page pdf and so it seemed like it should be pretty easy to attach multiple pdfs into one big multi-page file. Fortunately it is fairly easy (at the linux command line). There are windows tools to do the same, but today this is a linux tip….

Essentially – ghostscript is probably the way you’re going to want to go. For one reason, most every linux system should have it either installed or available. Here’s the basic approach…. (recommended form a newsforge article.)

gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=fulldocument.pdf page1.pdf page2.pdf

Now in my case, it was page1.pdf page2.pdf (you can add multiple files with multiple pages… maybe chapter1.pdf chapter2.pdf chapter3.pdf….)

gs is the main ghostscript executable, -dBATCH tells it to quit once we’ve processed the files, -dNOPAUSE keeps it from waiting for user interaction, -q makes it run without much in the way of messages on the screen (quiet), -sDEVICE=pdfwrite tells ghostscript to use it’s own pdfwriter and of course, -sOutputFile=fulldocument.pdf is the file you want to “lump” everything into…

Thanks to this article for a point in the write direction….

There are other ways to go about it. Many tools are out to make it an easier task to combine pdf’s into one big file, but that got me from point a to b.

Related Posts

Blog Traffic Exchange Related Posts
  • Using the command line in linux - part 4 Dealing with text.... we've looked at a couple of basics on logging in and starting to use the command line and hopefully not feeling too helpless there... we've seen ways to navigate directories and how to find new commands and how to find out more about how to use them.......
  • Tech support tutorials made easy on linux.... One of the real frustrations with phone tech support is translating step by step what is needed to the person on the other end. I know it sounds easy, but in reality - what if they've got xyz theme for their menuing and it's not there, what if... oh you......
  • Moving from Evolution to Konqueror After several weeks of good behaviour from Evolution 2.4 since the Mandriva 2006 upgrade, I started getting a wierd error on sending messages *(Mail From response Error Unknown). Nothing within my settings for Evolution had changed since the night before when things worked... I tested with Kontact and was able......
Blog Traffic Exchange Related Websites
  • SEO Principles for WordPress Blogs WordPress is a relatively SEO friendly blogging tool to begin with. It offers a linking structure that makes it relatively easy for spiders to crawl your pages, and the code contains very little validation errors if any at all. However, there are a few additional steps that you can follow......
  • RSS Feed Problems Some of my RSS subscribers may notice multiple versions of the same article and some articles from the Prosper blog showing up in my feed. As you may have noticed, I'm trying to bring my own articles written for Prosper into Lazy Man and Money (I have their permission for......
  • Ten Steps To Become a Linux/Unix Geek Until recently, Linux/Unix was considered OS of the geeks. However, with GUI and more desktop Linux distributions, things have simplified on both Linux and Unix. Still you can geek out with Unix/Linux using its terminal. Just follow the steps below to master the terminal. 1. Never used Linux! Get Ubuntu......    Send article as PDF   

Similar Posts

See what happened this day in history from either BBC Wikipedia
Amazon Logo

Comments are closed.

Switch to our mobile site