tail -f findings.out

« MySQL replication and flush tables with read lock gotcha

BlackBerry Storm: Thoughts and Tips »

Merging PDFs and the lovely gnome-open

I came across two very handy tools today: gs and gnome-open. gs (Ghostscript) is an interpreter for PDF languages. You can do lots of cool things with it, for which you can check the man page. The reason I needed it was to combine some PDFs created by my scanner into a single PDF. gs made this super easy:

1
2
gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=OUTPUT_FILE.pdf \
 -dBATCH PDF_TO_COMBINE_1.pdf PDF_TO_COMBINE_2.pdf

You just need to change the name of “OUTPUT_FILE.pdf” (the file to be created containing all the input files) as well as the “PDF_TO_COMBINE” files (your input PDF files, in the order you want them in the final doc). It doesn’t take very long to run, might spit back errors regarding format (at least it complained about the PDFs from XSane), but still should make the file. Easy and useful! Thanks to Debian Admin for providing a good example.

gnome-open allows you to open pretty much any file from the command line while in Gnome, using the preferred application for the file’s type. So to open a PDF, instead of navigating to it in a file browser and double clicking it, you just do:

1
gnome-open my_cool_thing.pdf

And it opens right up in Document Viewer (or whatever your preferred app for PDFs is set to). See more examples here. I also added an alias “go”, since that’s a lot shorter and more fun:

1
alias go="gnome-open"
Share and Enjoy:
  • email
  • LinkedIn
  • Slashdot
  • StumbleUpon
  • Technorati
  • Netvibes

Post to Twitter Post to Delicious Post to Digg Post to Reddit

Possibly Related (no promises):

  1. Checking options with optparse callbacks
  2. Easily sum matching file line counts

Related posts brought to you by Yet Another Related Posts Plugin.

Tags: , , , ,
December 23, 2008 - 11:50 AM
1 comment »
Leave a reply

Subscribe without commenting

Twitter links powered by Tweet This v1.6.1, a WordPress plugin for Twitter.