Here is my situation.
I have written a Database application in Java.
Now (unfortunately as an afterthought) I want to generate forms from data I pull from the database.
By form I mean a savable and printable file (not anything to do with UIs or swing).
Basically I want to take a template form and fill in things from the data I pull from the database.
Is there any simple API for this?
I really don’t care about the file format, it just has to be savable and printable (pdf, word, open office, ect.). Forms have to be able to have differing fonts and possibly images though.
I looked at Apache POI for MS Word docs, and a few other APIs and these seem extremely painful.
Has anyone had a good experience with any particular API?
Thanks for your help!
I would recommend iText because it gives you the functionality of writing Graphics2D to the PDF canvas, which means you can easily embed images and such in your form.
A minor issue with the library is that the best examples, I believe, are in the “iText in action” book by Bruno Lowagie (ISBN: 1932394796), which costs around 50 dollars US.
iText can have a rather steep learning curve, but for forms and such it should be fairly easy. Another advantage is that it can be used in combination with e.g. JFreeChart.
If you only want to fill out already generated PDF forms, iText is the way to go, since it has some great abstractions for doing exactly that.