Prawn + Prawnto = Ruby PDF win

posted by
pete

In early 2008 Greg Brown proposed that he become a "Ruby Mendicant". A paid, dedicated Ruby hacker that would work on projects that will benefit everyone. At the time, I thought it was little more than clever marketing but I'm happy to say that I'm really excited by what's come out of the money invested to date: an alternative to PDF::Writer called Prawn.

Prawn isn’t completely baked yet, but it’s quite usable for lots of tasks. In addition to having a really excellent object model and logical bounding and flow capabilities, it’s quick and doesn’t seem to be burdened with the cruft of PDF::Writer. It feels like a breath of fresh air.

Prawnto is a rails plugin leveraging the Prawn library to produce compiled pdf views. It’s like Haml for PDF; you get a local pdf object passed into a white-space indented template. Suddenly you can create sophisticated PDF documents in your application using a syntax with complexity somewhere between Builder and Haml. Yowza!

Prawnto is alpha technology built on Prawn, which is arguably beta technology, so you might not want to deploy it at your securities trading institution quite yet. (Although, it can’t make anything worse there, either… but this counts as a digression.) In the meantime, give it a try! So far, so good.