I work for a cheapskate company that doesn't want to license iText. For what we're doing, the cost is prohibitive. Is there any other library / servlet that I can use to create a dynamic PDF in memory and sent to the browser? Ideally, I'd like to have a static template and just have my code drop a few fields into the template such as name and address.
Any suggestions appreciated. I've searched this forum and the internets, but every discussion keeps pointing people at iText.
Oh and there is also FOP but it doesn't sound like you are starting from XML.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35241
7
posted
0
iText is free for most uses. And sending a PDF to the browser sounds like one of the free uses.
I don't think it is. Web apps are the case for which the Affero license was created specifically; distributing an iText-generated PDF to a browser would require distributing the source code. The Affero license is unsuited for most business uses.
Back to your question, the only other free PDF library I know of is PDF Box.
PDFBox is useful, but it doesn't have capabilities to create PDFs from scratch, so it probably doesn't fit.
FOP kind of fits the "template" approach, although you'd have to make an investment in acquiring XSL-FO knowledge.
Alternatively, check out the FlyingSaucer library which converts CSS-styled XHTML documents to PDF.
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12268
1
posted
0
I used FOP for a big project several years ago - worked quite well, but you are going to need to read up on XSL-FO. I used Holman's "Definitive XSL-FO".
Jeanne Boyarsky wrote:iText is free for most uses. And sending a PDF to the browser sounds like one of the free uses. What are you doing that requires a license?
Unfortunately, iText is not free for sending PDFs to browsers in a commercial setting. See this text from the link you provided:
Buying such a license is mandatory as soon as you develop commercial activities involving the iText software without disclosing the source code of your own applications. These activities include: offering paid services to customers as an ASP, serving PDFs on the fly in a web application, shipping iText with a closed source product.
Jeanne Boyarsky wrote:Back to your question, the only other free PDF library I know of is PDF Box. I haven't used it though as I use iText.
I'll take a look at PDF Box. I hadn't heard about this possible solution.
thanks,
seth
Seth Dustin
Greenhorn
Joined: Sep 15, 2010
Posts: 5
posted
0
I examined PDFbox and I think it might do the trick with the smallest investment in time for me to implement. The FSO stuff sounds intimidating.
At first I didn't think PDFbox would work because the feature set described in their command-line toolbox was missing the functionality I need, which is to add text in specific locations of a pre-existing PDF file. Then I checked out the cookbook and it looks like they have the methods I need...
I'll update this thread with details on my progress.
seth
Hauke Ingmar Schmidt
Rancher
Joined: Nov 18, 2008
Posts: 371
posted
0
iText up to version 2.1.7 is free in the LGPL sense, so you can send the PDFs to the customer without code disclosure. E.g. iReport uses 2.1.7 for exactly this reason.
Manu Moreno
Greenhorn
Joined: Aug 10, 2008
Posts: 1
posted
0
Another open source option for working with templates and generating pdfs (and other artifacts) is JODReports, these libraries depend on Openoffice and
provide an easy solution to generate pdfs from ODTs.
Abhilash Ms
Greenhorn
Joined: Feb 09, 2012
Posts: 1
posted
0
Seth Dustin wrote:I examined PDFbox and I think it might do the trick with the smallest investment in time for me to implement. The FSO stuff sounds intimidating.
At first I didn't think PDFbox would work because the feature set described in their command-line toolbox was missing the functionality I need, which is to add text in specific locations of a pre-existing PDF file. Then I checked out the cookbook and it looks like they have the methods I need...
I'll update this thread with details on my progress.
seth
Hi Seth,
Did this work for you? I am now exploring options of generating PDF files by inserting text in specific locations of a pre existing template file that could be created using word or any other WYSIWYG editor.