41

I am trying to render about 100,000 - 80 column records through FOP and it tanks pretty much everytime (OutOfMemoryException). I know iText could handle that kind of load but I can't use it because of the LGPL license. Are there any alternative Java libraries to iText that can handle rendering a high volume of data to PDF?

Jonik
  • 80,077
  • 70
  • 264
  • 372
Mike C.
  • 1,035
  • 2
  • 8
  • 13
  • Why not iText? http://stackoverflow.com/questions/602977/interactive-pdf-creation-alternatives-to-acrobat – KV Prajapati Sep 04 '09 at 03:51
  • Um, he mentioned iText but has an constraint because of the license. – cletus Sep 04 '09 at 03:53
  • 8
    LGPL is not GPL, as long as you don't modify iText itself it doesn't affect commercial projects. You may know this already (or it may not be up to you), but just making sure. – Yishai Sep 04 '09 at 05:35
  • 1
    iText is dual licensed; it is distributed under both MPL and LGPL. It is upto to you to choose which license you want to adhere. – Vineet Reynolds Sep 04 '09 at 10:27
  • You can find the license agreement @http://www.lowagie.com/iText/download.html – Vineet Reynolds Sep 04 '09 at 10:28
  • Unfortunately my company does not allow use of products using the LGPL or MPL licenses. So I must look for alternatives paid or otherwise. Thanks again for your suggestions. – Mike C. Sep 04 '09 at 13:33
  • 47
    IText has now got a very aggressive AGPL license – Bryan Hunt Feb 07 '12 at 17:43
  • 8
    As @Bryan Hunt wrote, IText has now a AGPL license and not LGPL which means that it is not appropriate for closed source projects. You have to make the code which use IText available for any user of your web application. – kroiz Jul 04 '12 at 16:01
  • 8
    Yeah, basically if you use iText, you need to write a server into which you send (for example) XML documents. Don't put any of your company internals or IP into it, and release it as open source. A lot of work when you just want to bang out a little PDF of a sales report. Using an old version of the library is an option but it seems that matey has decided to milk it for every penny it's worth. – Bryan Hunt Jul 04 '12 at 23:27

8 Answers8

27

There are commercial PDF generating libraries, such as BFO and ElegantJ. If you need open source, there is PDFBox, but I don't know if it is production ready.

Aswan
  • 66
  • 10
Yishai
  • 90,445
  • 31
  • 189
  • 263
2

Have a look at RenderX for an alternative to FOP.

It costs money, but if you have an existing solution in place that might be the cheapest.

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
2

Have you tried to increase the amount of heap available to the JVM? OUtOfMemory while processing huge amounts of data usually calls for more memory.

Jeroen van Bergen
  • 1,046
  • 6
  • 7
  • Yeah, the problem is FOP requires you dump all the XML doc in memory it simply can't handle the load. I increased the heap space up to 1GB and still a no go. – Mike C. Sep 04 '09 at 13:30
1

Qoppa and Crionics both offer commercial tools to create PDFs.

mark stephens
  • 449
  • 3
  • 2
1

There are some alternatives

http://www.ulimatbach.de/java/PDF-Bibliotheken.html

Matthias
  • 19
  • 1
1

try pdfjet is bsd licensed and there is also a commercial version with more features http://pdfjet.com/os/edition.html

sherpya
  • 4,890
  • 2
  • 34
  • 50
0

Aspose offers a PDF component for Java. Aspose is also used to create Word, Excel, PowerPoint... documents in Java (or .Net).

However, it is not a free software...

Romain Linsolas
  • 79,475
  • 49
  • 202
  • 273
-1

This might be a little late for you Mike C. but in case others have simliar large document low footprint requirements and redistribution requirements then it's worth sharing. Docmosis Community edition can be freely redistributed and can produce very large documents with a constant memory footprint (stream based processing). You (or your customers - since you're implying redistribution) would have to be willing to install OpenOffice somewhere though to allow the conversion.

Paul Jowett
  • 6,513
  • 2
  • 24
  • 19