3 Replies Latest reply: Feb 17, 2008 3:44 PM by etresoft
Dan White Level 6 Level 6 (9,425 points)
How can I print source from Xcode with line numbers ?

Intel iMac. Titanium G4 Powerbook, G4 iMac,, Mac OS X (10.4.10)
  • etresoft Level 7 Level 7 (27,125 points)
    I use enscript. I have an alias defined as:
    alias en='enscript --pretty-print --fancy-header --line-numbers --landscape --color --columns=2'

    In the Terminal, just type "en <file name(s)>" to print. You could also hack up something in the Script menu so you don't have to use the Terminal.
  • Tod Kuykendall Level 4 Level 4 (2,270 points)
    Also not a direct solution but opening your files in Text Wrangler (free version of BBEdit) will allow you to add line numbers that will print out. If you use TextMate I THINK it behaves the same as Xcode and gutter displays line numbers but doesn't print them. TextMate is so extensible there is probably a way to make it print them as well but I'm not that familiar.

    =Tod

    PS I am speaking of Xcode < v3 here. I've only dabbled in v3 so I can't say what may have been added.
  • etresoft Level 7 Level 7 (27,125 points)
    Tod Kuykendall wrote:
    PS I am speaking of Xcode < v3 here. I've only dabbled in v3 so I can't say what may have been added.</div>

    Not line number on printouts.

    Back in the '90s on Solaris, I used to have to hack up scripts for NEdit to print source code with enscript. Ten years later I have to do the same thing with Xcode.