Printing in Xubuntu with a2ps

UPDATE 05-30-08: The issue with Mousepad and similar applications not printing in Xubuntu has been fixed since Gutsy. So this post is no longer not needed by anyone with an recent version of Xubuntu. I'll leave it up just in case someone finds the technique useful in another OS.

Xubuntu is a fantastic OS, but it does have one persistent annoyance -- you can not print from Mousepad. That's kind of a problem if you are like me and always writing short little how to notes in Mousepad.

After poking around in the Ubuntu forums and a little trial and error I finally figured out a way to print from Mousepad.

Step 1. Install a2ps. This is easy, just run:

sudo apt-get install a2ps

Step 2. While installing a2ps does not actually make the "print" button work in Mousepad, you can print from command line. Here is the forumula:

a2ps --columns=1 --portrait -P PRINTER_NAME notes.txt

So to explain what all the directives mean:

----columns=1 tells a2ps to fill the full width of the page
--portrait tells a2ps to print the file in portrait mode.
-P PRINTER_NAME tells a2ps what printer to output to. An easier way to find the designation for you printer. Simply run this in command:
lpstat -d -p

Finally notes.txt is just the name of the text file you wish to print.

Of course you could always just copy the text into something like Abby Word, which prints right out of the box, but then you have to wait for a word processor to load up.