For a project at work, we were given a fairly interesting problem. We have a situation where the user is able to enter content using a in-browser WYSIWYG HTML editor. It works great. Fortunately there are a lot of great editors to choose from these days. The problem is that we need to be able to take this custom content and append it with an arbitrary set of PDF files to produce a single PDF file that the user can download and print. Only 2 or 3 users will ever use this feature but what they print will be seen by the general authorities of the church so it needs to look good. Concatenating PDF files is easy to do with iText. The problem is, how do we convert the custom HTML to PDF?
I got Googling and found ICEbrowser SDK from ICEsoft. I built a simple proof-of-concept that used ICEbrowser to render the HTML as a PDF. ICEbrowser SDK comes with an example for converting HTML to PDF. It works really well. ICEbrowser also uses iText to produce the PDF which gives us a great deal of flexibility.
The only problem is that ICEbrowser is a commercial piece of software. I was only able to download a 30 day trial version for my proof-of-concept. To use this in production we would have to license ICEbrowser from ICEsoft. That shouldn’t be a big deal right?
So I sent an email to ICEsoft asking about pricing. I also asked if we could get a not-for-profit discount since we’re a religious organization. After mailing back and forth about the nature of the project and what we wanted to use ICEbrowser for, we found out that it would cost $9,000 for the first server and $1,200 for each additional server we run our application on. ICEsoft doesn’t have a discount for not-for-profit organizations but apparently this is a 15% discount. On top of that there is a mandatory extortion support and maintenance fee of 15% for basic support and maintenance and 24% for standard support and maintenance. Ouch.
Why should we have to pay extra for support and maintenance? We already got the thing working. We don’t need their support. I didn’t like that idea of paying out $12,000+ for such a small piece of the project. No one on the project liked that idea. So I got talking with my co-workers and one of them mentioned Flying Saucer. Flying Saucer is an open-source XHTML renderer for Java. My co-worker had mentioned it earlier but since it has such a stupid name, I didn’t give it a second thought.
I went and took a look at Flying Saucer. I was very impressed. It’s not as feature rich as ICEbrowser but it does what we need. It also uses iText for rendering PDFs. To put the icing on the cake, Flying Saucer’s API is orders of magnitude simpler for creating PDFs than ICEbrowser. With ICEbrowser, I had about 8 different classes and I don’t know how many lines of code. With Flying Saucer, I have 5 lines of code to do the exact same thing.
In the end, Flying Saucer ended up being a much better solution and much cheaper solution. It’s no wonder I like open-source so much.
2 Responses
mheath
April 18th, 2007 at 5:35 pm
1I erroneously wrote in my blog that Ajax4JSF was created by ICEsoft. It was not. It was created by Exadel. Thanks to Igor Shabalov and Sergey Smirnov for quickly pointing out my egregious mistake. ICEsoft does produce some AJAX JSF component which is what likely caused my confusion.
I’ve updated my blog to remove the reference to Ajax4JSF.
Ashish
October 21st, 2008 at 3:55 am
2Nice post. Was looking for an PDF generator myself. Hope FlyingSaucer may fit in. Would be great if you had posted those 5 lines of code here as well
cheers
RSS feed for comments on this post · TrackBack URI
Leave a reply
Categories
Archives
Links
Meta
Calendar