This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes generate PDF without using iText? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "generate PDF without using iText?" Watch "generate PDF without using iText?" New topic
Author

generate PDF without using iText?

Seth Dustin
Greenhorn

Joined: Sep 15, 2010
Posts: 7
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.

thanks,

as
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30057
    
149

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?

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30057
    
149

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: 41049
    
  43
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.


Ping & DNS - my free Android networking tools app
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12758
    
    5
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".

Bill
Seth Dustin
Greenhorn

Joined: Sep 15, 2010
Posts: 7
Jeanne,

Thanks for your input on this topic.

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: 7
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: 433
    
    2
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
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
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: generate PDF without using iText?
 
Similar Threads
Convert Editable Pdf into Non-Editable Pdf
convert word documents to PDF
Modifying pdf with itext
iText and template.
iText and FDF