Thu 6 Jul 2006
Create Dynamic PDF documents on the fly with iText
Posted by anadeau under Developer Wing , Open SourceHave you ever had a co-worker/colleague/boss ask you “Hey, How hard would it be to have that report in PDF for our software system?”
If so, maybe you’ve felt like I used too… “Well… umm… I think it’s possible… probably not to hard, but could be difficult… do we really need that?” (My business partner heard that one a few times)
That was my answer for awhile… until I discovered a great Open Source project named iText
iText is a very simple Java package that is very easy to install and use within your applications. We had a requirement to actually create a very dynamic web application that could create bookmarks and cards to hand out with pictures of people on them and text under the pictures… all lined up perfectly for different layouts… yada yada yada. We decided to go with iText to create PDF files to print the information that needed to be dynamically entered and captured since PDF’s seem to print much better than trying to print directly from HTML pages.
You may have similar requirements for a project, if so I strongly recommend checking out iText. All you have to do to set it up is download the jar file and include it in your classpath. Then the next step I would recommend is visiting the Examples page and going through most or all of the code examples to get comfortable with the code and how it works! Nothing helps understand a product more than solid examples and there are plenty of them there.
Another very helpful link is that to the actual API for iText. Once you become more familiar with how the package works, you’ll want to dive into the API for even more information and methods.
iText seems like a very solid Project that’s been around for awhile. The mailing list is supported very nicely with a number of users currently subscribed. I’ve also included a link here to a number of books that might help even more if you really want to learn how to create dynamic PDF’s within your applications. Click here to view books from Amazon.
As a developer I think this is very important package to look into. I think just about every application we develop could use some sort of PDF creation for reports, calendars and even bookmarks!
Thanks for dropping in, keep on developing in the open source world!!!
Adrian