Export terminal display to PDF
I would try writing the syntax-highlighted code as an HTML file, using the Vim Syntax->Convert to HTML menu option. Then open the HTML in a browser and print to a PDF file. You can of course edit the HTML if you want to show just a section of the code, or use pdfcrop to isolate the region of interest.