New Project: Prawn::Graph - Put some Graphs in your PDFs

Prawn is the fastest pure Ruby PDF generation library available. It really is pretty cool and takes most of the ouch out of generating print-ready documents.

I recently had the need to be able to generate report documents in PDF format, and found Prawn to be the best out of all the available Ruby tools to do the job.

The thing that was missing, however, was built-in support for adding graphs and charts to these reports I was generating. Of course, I could have used something like Gruff to generate a pretty PNG or JPEG of a graph and then embed that in the PDF; however to me this seemed inelegant and I was loath to add another bunch of dependencies to my application (Gruff, RMagick).

And so, I created Prawn::Graphs, It’s a very simple abstraction on top of prawn/graphics that draws Graphs. Find out more about it and see some usage examples on the project page.

The most nifty thing about this implementation is that it only relies on Prawn and the methods it exposes through prawn/graphics to do its work. That’s right, no RMagick, no embedded images, just native PDF graphs.