Ask YC: Open source HTML to PDF

4 points by matticakes ↗ HN
Any suggestions for a solution to producing PDF's automatically from dynamic output?

Something preferably able to produce output similar to manually "Printing to PDF" from a browser window...

8 comments

[ 3.3 ms ] story [ 29.6 ms ] thread
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.
This is impressive, thank you. Gotta love well-formed XHTML.
there are a good handful of options. what language would you prefer? or do you want some separate system?
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.
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.
My use case is basically taking an automated web-based daily newsletter (html, css, images) and generating a PDF