Why do you print them to PDFwriter first? To save the color coding? There are dozens of text editors with syntax highlighting. I'm sure some of them will let you copy with color in tact. There is a thread listing a dozen or so (I think you posted in it, so I'm sure you know).
I'd still do it in PHP (or Perl). If you do it in PHP, use SilverStar's C highlighter at
http://nrg.chaosnet.org.