Possible Duplicate:
Converting HTML files to PDF
I have HTML in java string and i want to render it as a PDF. Is there any API or reference Available for free?
Possible Duplicate:
Converting HTML files to PDF
I have HTML in java string and i want to render it as a PDF. Is there any API or reference Available for free?
Take a look at Flying Saucer. It is CSS 2.1 compliant, it even covers some CSS3 features, and it uses iText under the hood. I've found it quite useful to convert XHTML to PDF.
Depending on the complexity of your HTML code, you could give a try to iText's XMLWorker.
The project :
http://sourceforge.net/projects/xmlworker/
The demo (paste your HTML there to check what the generated PDF will look like) :
http://demo.itextsupport.com/xmlworker/
The documentation :