You can use the Apache FOP Java API, see http://xml.apache.org/fop/.
do need to write an XSL-FO stylesheet to apply to your XML to produce the
input to the Apache FOP driver.
You don't need to write out an XML text file. Look at a SAXSource as an
alternative. Create an XMLReader implementation that feeds the excel cell
information directly into start/end elements on the ContentHandler, and
create a SAXSource using that XMLReader. That's your document. Then you
need an XSL-FO stylesheet. Then you perform a JAXP transform that takes
your source, transforms it with the stylesheet, and writes the results into
the ContentHandler of the Apache FOP driver.
----- Original Message -----
From: "Mahesh Devjibhai Dhola" <ondemand_mahesh@...>
Sent: Thursday, February 17, 2005 9:06 PM
Subject: [XSL-FO] Want to convert Excel file to PDF
> I have requirement that i need to generate pdf from excel file. The
> formats and cells will come from excel file, get data from beans and then
> write pdf file.
> for this, i have read excel file and gather information in my classes
> using POI-HSSF apis. that work is done.
> Now i want to write the pdf file, can you give me any idea how to do that?
> I have tried to generate xml file from excel file using JExcelAPI but then
> i have not XSL file so how i can generate pdf using XSL-FO, because
> atleast fo files or xml+xsl file needed to generate pdf.