tags:

views:

194

answers:

4

I was looking at using iText to create both a pdf and html version of a document with RTF as a possible option. According to this question this is no longer possible with iText. Is there a library that will allow me to create a document in Java and output it as both PDF and HTML? The ability to output RTF would be nice but is not required.

+1  A: 

As that answer to the other question states, you can just use the iText RTF Library.

Anon.
+1  A: 

JasperReports. If you look at this package it supports export to:

  • pdf
  • html
  • rtf
  • xls
  • xml

You have two options to create the documents:

  • via iReport - a visual designer for reports
  • via an API, where you construct everything with Java code.

Note that even though JasperReports's main function is to create reports, it can very well create other documents, with no tabular data for example.

Bozho
A: 

I have used PD4ML to convert HTML to pdf. Even though it is a commercial app. It is very reliable and supports CSS well.

Vinodh Ramasubramanian
A: 

You could also try Docmosis since that supports the output formats provided by OpenOffice (including the ones you specified) and you can often do the job with a lot less code.

jowierun