Visual Studio: Export C# Code into a PDF file and keep the formatting + colors?

This is a job for CutePDF. Just install it, and go to file->print in Visual Studio.


I wanted to do this myself so google brought me here. Then I had a mini brainwave and remembered "Microsoft Print to PDF" which is built in as an option in the print menu. I tried it and it worked!

So just go File->Print, then choose Microsoft Print to PDF as the printer, then choose where to save your printout.enter image description here

(P.s. my code is awful. This file is from an old app I wrote lazily and intend to overhaul)