How do I print source code?

For black and white printing you can use enscript - if it is available on your platform.

Go to Run ‣ External Tools ‣ External Tools Configurations… and follow the next steps:

../../../_images/enscript-print.png
  1. Create a new Launch Configuration

  2. enscript location (you can use which enscript command to get its path)

  3. enscript arguments

  4. Apply ‣ Run

The above enscript arguments (-2rT4v -DDuplex:true -dPhotosmart_C5100) used in this example mean: 2 = 2 columns on page,r = landscape, T4 = tab size 4, v = verbose, Photosmart_C5110 = a printer name

See also man enscript (in a Unix/Linux console).

For color printing, you can copy/paste into Word / Open Office. The highlight is preserved. You can customize fonts / preview etc. in office tools.