Install gvim. Write a small utility to save the current file to a filename with an extension indicating the current filetype. (.html, .pl, .c, etc) Then run the following shell command:
\ngvim -f +"syn on" +"run\\! syntax/2html.vim" +"wq" +"q" $filename\n
Now read back $filename.html. Post-process that slightly if you want.
(You may not need to escape ! depending on how you execute this - in bash I need it.)
This will work somewhat better if gvim has access to X. (According to the documentation it does a better job of picking colors, whatever that means.)
Voila!
Cheers,
Ben