
Prawn is a new pure Ruby PDF generation library developed primarily by Gregory Brown.
Back in March, Gregory tried to raise $13000 so he could spend six months working on Ruby-related open source projects. He eventually raised $5525 from the community plus $5000 from Ruby Central and has spent the last few months working on Prawn.
Prawn can be installed from a pull from GitHub or, for those of us who are less adventurous, with a gem install prawn. Once installed, you can give it a quick test run:
require 'prawn' Prawn::Document.generate("test.pdf") do font "#{Prawn::BASEDIR}/data/fonts/DejaVuSans.ttf" text "this is a test " * 100 end
Prawn comes with 11 typefaces, including Helvetica, Courier, DejaVuSans, Times, and everyone's favorite - Comic Sans. It already supports image embedding, table drawing, and content positioning, but a lot more is yet to come. Prawn is now ripe for more community involvement and support, so if you want to help (Gregory's looking for a logo!) the prawn-ruby Google Group is a great place to start.
This post is sponsored by KickStart Events — RubyOnRails Training at the EMCC (East Midlands Conference Centre), UK. High-quality hands-on workshops and courses for web application developers. Taught by experienced mentors using live coding sessions, slides and participatory discussion.
by Genís