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
  • More Command Line Interface Magic.... Aliases Enterprise Linux has a good article on some handy aliases under linux that can make CLI usage much more handy. The only warning I would have is to be careful that an alias you want to create doesn't conflict with another useful program. (One of the comments noted that ld......
  • Ebay "sell your item" upgrade leaves linux behind? Ebay is apparently aware of some problems with their new "Sell your item" tool and linux web browsers. The linux.com article above says that they tried with several browsers windows/linux/mac and the common denominator was linux. Even firefox on linux failed where firefox on windows worked (and the user agent......
  • 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.......
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......
  • Podcasting Made Easy A podcast is probably the easiest way of getting your voice or music over the internet, and this article will tell how to make a podcast. You will need a domain and a host for you site if you don't already have one. You can get a domain from places......
www.pdf24.org    Send article as PDF   

Similar Posts


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

Comments are closed.


Switch to our mobile site