Flying Saucer (https://xhtmlrenderer.dev.java.net/) is a pretty badass solution for what you want. It's a Java library, but you can use it in Ruby or any other language that runs on the JVM pretty easily.
I'm not sure what your use case is, but we've had much better luck with generating LaTeX code that we compile to PDF (the trivial step) than with doing HTML to PDF.
It doesn't necessarily need to be built into the language that the content is being produced in. I came across HTMLDOC, for example. I suppose anything that can run on linux.
Depending on your use case, check out [Sphinx][1], which is used for the new [Python documentation][2]. Basically, you write your documentation in [reStructuredText][3] which Sphinx then renders into HTML or LaTeX. The LaTeX output can be trivially turned into a PDF and [looks great][4].