Hacker News new | past | comments | ask | show | jobs | submit login

I've used PhantomJS with CoffeeScript, and Reportlab with Python.

The PhantomJS solution became a bit painful, since there are issues with the way Qt converts HTML into PDF. I was impressed that even SVG generated with D3 faithfully was converted to PDF. But not being able to precisely control formatting was a problem.

After that I decided to try Reportlab, and it's been amazing. There is a free open source Python API version, and the commercial Report Markup Language product (RML). It's possible to mix Python and RML with a template engine (Preppy), very powerful. We opted for the commercial support, since time was a factor. RML is really baked, it's been around for over a decade. The documentation is extensive, but I still had to find a couple of things via googling. However, their commercial support is awesome.

If you don't want to spend a lot of time handcrafting documents, I recommend RML, despite the cost. It has features for page layout control, fonts, tables, styling and multipage text flow. There's even a charting library, which I didn't use yet. Also important was the ability to include existing PDF pages as backgrounds or chart inserts.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: