Saturday, February 28, 2009

Merging PDF documents

Having its origins in the GNU community over 20 years ago, Ghostscript (gs) was designed as a free interpreter for Adobe PostScript with an intention of saving trees and named as a play of words on that. Along with providing tools for raster image processing and converting between different document formats, it also comes with a peculiar pdf/ps viewer called Ghostview (gv), which I am not sure of ever using over good old evince.

Nevertheless, I find some command line gs utils incredibly powerful. Lets say you wanted to merge two pdf files. Just say:

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

The options are somewhat involved and long to explain here, but you can read through the documentation. If you want to save the typing, add

$ alias mrg='$ gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=output.pdf'

to your .bash_profile and then use

$ mrg file1.pdf file2.pdf

to get a merged output.pdf. Pure GNU.

1 comment:

  1. Do you need to increase your credit score?
    Do you intend to upgrade your school grade?
    Do you want to hack your cheating spouse Email, whatsapp, Facebook, instagram or any social network?
    Do you need any information concerning any database.
    Do you need to retrieve deleted files?
    Do you need to clear your criminal records or DMV?
    Do you want to remove any site or link from any blog?
    you should contact this hacker, he is reliable and good at the hack jobs..
    contact : cybergoldenhacker at gmail dot com

    ReplyDelete