News for hackers. Stuff that matters.
Re:PDFs in Pure Ruby by patio11 on Thursday January 21, 2010 @11:24PM (#1069117)
wc -l Print(ASTERIX_BORKS_HN).java #6 files, 1,800 lines

wc -l print_job.rb #1 file, 125 lines

This is not, strictly speaking, a fair comparison. In addition to being a superior version of everything the Java version does, the Ruby version also does GIF export, caching on the web server, and basic feature-wide analytics. The Java just barely staggers its way to generating a NxM grid and putting pleasingly aligned text in it. It is also littered with comments like:

// DO NOT EDIT. WILL NOT BE ABLE TO FIX. See r47 for what happened last time. (See r53.) (See r128.)

Do it in Prawn. I seriously have attempted to get my company to run a one-controller Rails app just to do PDF generation, because it would be cheaper going forward than the prodigious amount of effort we spend on report generation in Java. (This was, sadly, not approved.)

Re:PDFs in Pure Ruby by sandal on Thursday January 21, 2010 @11:29PM (#1069122)
Prawn should run perfectly in JRuby, and will be officially supported by its 1.0 release. Sneak it in a .jar :)
Re:PDFs in Pure Ruby by patio11 on Thursday January 21, 2010 @11:36PM (#1069131)
I actually considered doing just that, for weeks. As much as I would have loved to do it, the Java application is a desktop app, and putting in JRuby would have added something like 15 MB to the installer.

I did propose that to work, though (we do generation on the server so the size doesn't matter), and we have done it if we had an acceptable supply of Ruby-speaking engineers. Bad news for them, good news for me: I would hate to have their business hobbled when I leave.