views:

708

answers:

4

Currently I am using FOP to generate a pdf from java code and an xslt document. The FOP spits out a PDF file that is displayed (embeded) into a webpage. The documents can range between one and several thousand pages long, and it can take some time to generate them.

Is there a better tool that and do this? Is FOP the best option in the opensource and free world?

+4  A: 

We use iText.

Here is a blog entry Comparing Apache FOP with iText.

Judging by your usage (generate a pdf from java code and an xslt document) it seems like FOP is the better choice for you.

EDIT: This forum post about FOP Vs IText includes the following:

iText is more feature rich than FOP as far as PDF is concerned: you can add annotations, create AcroForms, digitally sign a PDF document. Also iText is the only solution if you need to generate PDF documents containing thousands or ten thousands of pages.

Grant Wagner
I'll also vote for iText. By the way, if your PDFs happen to be reports, you can use JasperReports: http://jasperforge.org/plugins/project/project_home.php?group_id=102
Jeff
+1  A: 

You can use OpenOffice.org, running as a server and command it remotely for document convertion.

Besides HTML to PDF, there are also possible other convertions: doc --> pdf, html, txt, rtf xls --> pdf, html, csv ppt --> pdf, swf

Code example:

import officetools.OfficeFile; ... FileInputStream fis = new FileInputStream(new File("c:/test.html")); FileOutputStream fos = new FileOutputStream(new File("c:/test.pdf"));

// suppose OpenOffice.org runs on localhost, port 8100

OfficeFile f = new OfficeFile(fis,"localhost","8100", true); f.convert(fos,"pdf");

From: HTML to PDF with PHP, Java or ASP: dancrintea.ro/html-to-pdf/

A: 

Adobe ColdFusion has the best built-in PDF support.

Henry
A: 

This answer is too late for you, but in case it helps other searchers, Docmosis can generate documents at a fairly hefty rate, and can spread a high load across multiple machines. It uses OpenOffice as the underlying format conversion engine, adding document population and manipulation facilities via the Docmosis Java API.
Several thousand page documents are going to take most systems a while, but if the system (or your code) allows you to parallelise and distribute the effort, then at least the average document rate can be high, even if the individual document time may be significant.

JODReports is another similar option.

jowierun