Comparing Ruby PDF gem for PDF document generation

There seems to be 2 main Ruby pdf gem’s doing the rounds at the moment:

  1. PDF::Writer: see site and the manual
  2. Prawn PDF: see site and the manual
  3. PDFKit: see site

So the first to ruby PDF gems are for writing custom PDF’s using unique positioning and graphical elements where as option 3 is converting html into PDF.

So the purpose of this evaluation is to choose the best of the two suited for the following exercise:

How do you combine the flexibility of these 2 ruby pdf gems with some funky intelligent graphing capability for reports?

So the reason for option 3 is obvious. We can use a javascript library like D3 to embed graphical elements into an HTML file and just render that to PDF.

So I believe that this covers the right aspect of tools to determine what is the best approach.

The answer: you will have to wait and see.

Installing Prawn PDF ruby pdf gem

With rvm install, change to the ruby version that you are interested in on your machine

So on the command line:

rvm 1.9.3

sudo gem install prawn

Done

Installing PDF::Writer ruby pdf gem

For PDF Writer 2 additional gems are needed:

transaction-simple-1.4.0.gem

color-1.4.1.gem

So on the command line

rvm 1.9.3

sudo gem install transaction-simple v ‘1.4’

sudo gem install pdf-writer v ‘1.1.8’

Installing PDFKit

So on the command line

sudo gem install pdfkit

Interesting Infoware Studios Bookmarks

    WP HTTP Error: Couldn’t resolve host ‘feeds.delicious.com’

  • Delicious See on delicious : ruby

0
  Related Posts