Skip navigation
This discussion is archived

Printing from Xcode: Line Numbers ?

1865 Views 3 Replies Latest reply: Feb 17, 2008 3:44 PM by etresoft RSS
Dan White Level 6 Level 6 (9,420 points)
Currently Being Moderated
Feb 15, 2008 8:36 PM
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 (23,880 points)
    Currently Being Moderated
    Feb 17, 2008 8:22 AM (in response to Dan White)
    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.
    MacBook, Mac OS X (10.5.2), 1.83Ghz/2GB Ram/160 HD et al.
  • Tod Kuykendall Level 4 Level 4 (2,270 points)
    Currently Being Moderated
    Feb 17, 2008 10:00 AM (in response to Dan White)
    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.
    G5/2.0x2, Dual XServes x2, XRAID, beige G3 501Mhz
  • etresoft Level 7 Level 7 (23,880 points)
    Currently Being Moderated
    Feb 17, 2008 3:44 PM (in response to Tod Kuykendall)
    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.
    MacBook, Mac OS X (10.5.2), 1.83Ghz/2GB Ram/160 HD et al.

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.