Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to use gedit or some similar program just as a page formatter and pipe some text through it and onto the printer. | lpr just doesn't cut it in the presentation department. The printed output is subpar, even if I try to tinker with the margin and font size options. But I like the way text looks like when printed from gedit. Is there a way to have the best of both worlds and use a command line pipeline to print a text file with gedit-quality formatting?

share|improve this question
up vote 9 down vote accepted

There is a2ps utility for pagination and pretty printing of plain text.

share|improve this answer
Works great.Thank you. – dan Feb 23 '11 at 4:55

I use OpenOffice. The command runs like this openoffice -p file.txt. This will print file.txt to your default printer. openoffice -pt printername file.txt will print to other than default printer. It will work with other document formats support by openoffice. Check man openoffice for more options.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.