Linux.com

Home Linux Community Forums Hardware Printers Printing code in color to color printer?

Printing code in color to color printer?

Link to this post 13 May 11

Hey,

Someone once showed me a simple command line way to print a file of code (Perl, Bash, etc.) on a color printer that honored the syntax highlighting. I have since forgotten it - anyone know what this might have been?

thx

Link to this post 13 May 11

atreyu wrote:

Hey,

Someone once showed me a simple command line way to print a file of code (Perl, Bash, etc.) on a color printer that honored the syntax highlighting. I have since forgotten it - anyone know what this might have been?

thx

If you pipe the coloured text to the printer it should work...

Or did you mean something like "fileutil"?

Regards

Link to this post 13 May 11

i just gave up and used gedit - never used fileutil tho. if i get time...

EDIT: or, it can be done right in vim, i've just learned. cool. this is one of several ways to do it w/vim that worked for me:

vim -me -e -c ":hardcopy >%.ps" -c ":q" test.sh
lp -d COLOR_PRINTER_NAME test.sh.ps

more at http://aplawrence.com/Girish/vim-tips.html for anyone interested...

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board