views:

1463

answers:

8

At the moment, I'm creating an XML file in Java and displaying it in a JSP page by transforming it with XSL/XSLT. Now I need to take that XML file and display the same information in a PDF. Is there a way I can do this by using some kind of XSL file?

I've seen the iText Java-PDF library, but I can't find any way to use it with XML and a stylesheet.

Any assistance would be much appreciated. Thanks in advance!

+1  A: 

You might want to look at the XSL-FO libraries that are out there that can do PDF creation as a transformation. I'll try to find a link.

Mitchel Sellers
+10  A: 

You can use XSL Formatting objects. Here are some good articles on how to do it.

Bogdan Maxim
+1  A: 

BIRT.

birt home

Has a create GUI for eclipse that lets you define the PDF from xml, db, csv, etc etc.

jeff porter
+3  A: 

You can also check apache project here

hakan
A: 

Use JasperReports. You can either pull the data from Database or XML. You can export to many formats : pdf, excel, html, etc...

raffimd
+1  A: 

Try the xhtmlrenderer project. See the article "Generating PDFs for Fun and Profit with Flying Saucer and iText".

axelclk
A: 

Apply xsl to your xml and transform it to html. Then you pass this html to Corda Server. This will give you the required pdf.

Amit Dave
A: 

Coming in late, you can create a static PDF with Adobe's designer with editable fields, then create a matching XDP XML document.

Dean J