I have to generate a simple PDF document from a little java batch (Java 7). The generated document will contain a list and a couple of tables (nothing fancy). Aside from license problems (AGPL is not an issue in this case), which library is faster/easier to implement and has better performances between iText
and Apache FOP
for the desired output?
Asked
Active
Viewed 3,053 times
3

Matteo Baldi
- 5,613
- 10
- 39
- 51
-
Why not take a look at pdfbox? Its simple and free! – Rabbit Guy Apr 07 '16 at 20:34
-
@blahfunk I haven't considered it, a couple of colleagues suggested me FOP or iText – Matteo Baldi Apr 07 '16 at 20:36
-
I had a project here at work where I needed to manipulate and even create on the fly pdf's and after pulling teeth I found pdfbox. It is free and fairly simple to use. – Rabbit Guy Apr 07 '16 at 20:37
-
Well, I work for iText as QA Engineer, and we compared performance and feature sets with several competitors, and we should probably put our findings online, including the full source code of the tests, because it's actually pretty favourable for us (I have the xlsx with the results open right now). But please please please don't take my word for it! I'm going to forward this question to our marketing people, to see what can be made public. My personal vision would be a Github repo, where we do identical things with iText, FOP and PDFbox, and measure the results. *But no promises! ;)* – Amedee Van Gasse Apr 07 '16 at 21:06
-
1Note that we also compared the ease of use. How easy is it to write an application with different libraries and how easy is it to maintain the code. The lack of high-level object in PdfBox was a real showstopper in many cases. It also makes it more difficult to maintain thd code. That makes the cost for using PdfBox high. As for FOP, the performance csn get really bad for huge tables due to the flawed design. You first need all the content in XML format before you can start generating PDF. Writing thd XSL can also be a challenge. – Bruno Lowagie Apr 07 '16 at 21:13
-
Someone once made a study for PDF libraries on Android: http://stefan.fenz.at/creating-pdfs-on-android-an-evaluation/ FOP was considered "inappropriate"; iText beat all the tested libraries in speed. – Bruno Lowagie Apr 10 '16 at 07:45
-
[May be this can be a help for You](http://stackoverflow.com/questions/6625849/pdf-generation-with-java-what-to-use-itext-apache-pdfbox-or-fop) – Sanjeev Apr 12 '16 at 10:41
-
Please refer to http://stackoverflow.com/questions/6625849/pdf-generation-with-java-what-to-use-itext-apache-pdfbox-or-fop?lq=1 – LONGHORN007 Apr 13 '16 at 11:22
1 Answers
3
As you said , you don't need fancy tables and you need faster and easier library to implement, I'd prefer iText because it is very much simpler than Apache FOP. It is very easy to add list and tables to your PDF document by using iText. Apache FOP is much concerned about generating PDF documents in which the data to be written is stored in XML. Basically Apache FOP's main objective is to convert XML files to PDF ones. You can visit here for more details:- http://blog.xebia.com/comparing-apache-fop-with-itext/

Ashish Sharma
- 220
- 3
- 10