Print code with syntax highlighting on a Mac

3

What could I use to print javascript, php or css code in colour? I've tried the following:

  1. Textmate
  2. Dreamweaver CS3
  3. Firefox viewsource extension
  4. saving webpage as a pdf

All of these result in black and white code. It seems such a fundamental thing and most Windows text editors have this basic functionality. Has anyone got anything that can do this in OS X?

Pickledegg

Posted 2009-10-12T21:45:18.277

Reputation: 603

Answers

2

Have you tried TextWrangler or its big brother, BBEdit from Bare Bones Software?

Jim Ferr

Posted 2009-10-12T21:45:18.277

Reputation:

textwrangler saves the day :) cool little editor. – Pickledegg – 2009-10-13T10:39:27.940

2

Vim/Gvim has no problem with printing syntax highlighting. Just pick some nice colour scheme (preferably with a white background) and :hardcopy.

Rook

Posted 2009-10-12T21:45:18.277

Reputation: 21 622

i thank you for your help, unfortunately I'm not quite at geek factor 9 yet, so I've chosen a laymans tool :p – Pickledegg – 2009-10-13T10:40:34.913

oh, i don't mind ... i also thought gvim was a little weird before i started using it ... then after picking out my brain, and putting it a new one and completely reprogramming it, i now happily use it everyday :) – Rook – 2009-10-15T17:17:46.497

1

I know for a fact Netbeans can do this, and it is multiplatform. It can also save the code as a webpage with syntax highlighting that you can print.

John T

Posted 2009-10-12T21:45:18.277

Reputation: 149 037

1

Xcode and Dashcode will preserve the syntax highlighting when printing and copying to the clipboard.

Steve Harrison

Posted 2009-10-12T21:45:18.277

Reputation: 111

cool i'll check out dashcode, although it appears to have vanished from my os. :) – Pickledegg – 2009-10-13T10:41:19.373

@Pickledegg: You'll have to have the Developer Tools installed. They come as an optional install on the Mac OS X installation disc. Alternatively, you can download them from http://developer.apple.com/technology/Xcode.html (free ADC membership required).

– Steve Harrison – 2009-10-13T22:32:10.043