How can you print a text file via gedit from the command line?
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?
There is a2ps utility for pagination and pretty printing of plain text.
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.