How do students create a pdf of their code?

There is some discussion about this in this thread. Check it out.