This… might actually work. Thanks!
I was already using Pygments to highlight my source code and was thinking if I could print them highlighted with it.
Pygments has many formatters to format output. I used .rtf but you can also output images as well.
(I didn't have to print line numbers back then)
You can generate LaTeX documents, images etc. with line numbers. And then print them. hmm.