require 'color'with this line:
require File.dirname(__FILE__) + '/color'That's it! Oh, and don't forget to set the path to your Ghostscript executable like so:
RGhost::Config::GS[:path]='/opt/local/bin/gs'Enjoy!
If this was useful for you, please take a minute and recommend me:
Thank you!
Comments
Johannes Fahrenkrug said...
Hey Greg,
That's great news, thank you! For performance reasons I went with HTMLDOC for the project I mentioened. But I'm considering Prawn for a different project I'm working on right now. Btw, will you be at Scotland On Rails? I'm considering it... would be great to meet.
Gregory Brown said...
Though it's probably way too late for your needs, Prawn now handles tables that are too wide gracefully thanks to a patch from Andrew Timberlake. This will make it into Prawn 0.4
-greg
Gregory Brown said...
I like HTMLDOC too but it runs into serious limitations when things get too complex.
Also, licensing is less than ideal, you have the choice between GPL or a commercial license, whereas License of Ruby (which is dual-licensed with GPL) or the MIT/BSD licenses are far more appealing.
Johannes Fahrenkrug said...
Hey Greg,
Thanks for the comment. Yeah, RGhost is pretty cool, BUT I ended up using HTMLDOC. Tables are a pain with RGhost because you'll have to manually calculate the right column widths. HTMLDOC just takes an html stream/file and works like a charm. I'll blog about it later. Speed improvement of a pdf with a 8 column table, 9 pages: PDF::Writer: 17 seconds (!), HTMLDOC: 0.5 seconds. Nice!
Gregory Brown said...
Wow, I've never seen RGhost.
That's very cool stuff. I'll have to contact the maintainer so we can collaborate a bit.
Obviously there is a difference between relying on Ghostscript and doing pure Ruby PDF generation, but the library looks very mature and cool!
Gregory Brown said...
Johannes,
January 18, 2009 12:56 AMReleases previous to Prawn 0.3 had a strange dependency issue that made it run about 4x slower than it should. If you were trying one of these earlier releases, you might check out the latest version and see if it performs better for you (Though I doubt we'll beat HTMLDOC in any case).
Unfortunately, I won't be at Scotland On Rails. I'll be going to several US based conferences and maybe RubyKaigi if I'm lucky, so please let me know if you make it to any of those.
Also, feel free to let us know how things go if you use Prawn on your upcoming project. Or better yet, write about it here!