3 ms·
I am not a Ruby programmer so this might be a dumb question, but how does Prawn compare to Itext(Java)?
by plinkplonk 17y ago
I am not a Ruby programmer so this might be a dumb question, but how does Prawn compare to Itext(Java)?
- sandal 17y agoItext is certainly more feature complete, but Prawn is pretty capable. It probably is more pleasant syntax-wise than iText, so for simple needs, Prawn might be better. iText is almost certainly significantly faster, but I haven't benchmarked. If there are very cool low level features in iText that you'd like to see in Prawn, let us know on our mailing list.
- patio11 17y agowc -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.)
- sandal 17y agoPrawn should run perfectly in JRuby, and will be officially supported by its 1.0 release. Sneak it in a .jar :)
- patio11 17y agoI 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.