Apple - Printing source code with OS X

You can print source code with line numbers and without truncation in TextWrangler, the key is Soft wrap text.

  1. Turn on "Soft Wrap Text" under Text Options.

  2. Open TextWrangler > Preferences

  3. Select "Text Printing" then check the "Print line numbers" checkbox.

  4. Print again, long lines should wrap and line numbers should be present.

Note: you may want to set up "Editor Defaults" in TextWrangler's Preferences, and have it Soft wrap text for you for each file you edit, and to a specified width too.

enscript can be installed via Homebrew and used via Terminal. Start with

enscript -CG2rE -U2 my-source-file.PHP

and read the (extensive) man page for additional features.