views:

97

answers:

4

HI all,

do we have code in java that can generate html content to pdf file and sends back browser.

please help out if there is anything that i can use to do it

Thanks kumar kasimala

+2  A: 

This is the best way I found of how to convert HTML to PDF using open source API/Tools

Converting HTML to PDF using open source APIs/Tools

Apps used:

  1. Apache FOP

  2. A xhtml to fo stylesheet: xhtml2fo.xsl

  3. HTMLCleaner

Also read: Convert HTML content to PDF format

zengr
A: 

I have used Apache FOP for this some years before. It works on an XML source like xhtml and can produce PDF and other output formats.

Arne Burmeister
A: 

Check out iText, it is very good.

Joe R
iText is awesome, but not a good option if the app is closed source.
zengr
That's true, but don't the solutions you propose include open source software?
Joe R
Hi what do you mean by closed source?
kumar kasimala
@kumar kasimala - I think zengr means iText is a problem if your application cannot use open source soltions.
Joe R
A: 

Try the PDF Converter services. It supports loads of formats including HTML and works from any Web Services capable environment including Java and .net.

Here are some examples:

Note that the articles may mention SharePoint a couple of times. Don't worry, the product is not tied to SharePoint, it just happens to be used a lot in that environment.

Big disclaimer, I worked on the product so I am obviously biased about how fantastic the product is :-)

Muhimbi
It's not cheap at $1500 :)
zengr
'Cheap' is in the eye of the beholder. Most of our customers find it pretty cheap, but if you have no budget and are looking for a free solution then it is not the same as free :-)
Muhimbi
Hi Muhimbi,Is that one time purchasing?. is it depends on for one user?. we want to plugin that we dont want to upgrade once we purchase it, we will use it along with our app, is that possible?
kumar kasimala
That is the price per server. If you have more than 3 servers then you are best off purchasing the enterprise license that allows deployment on an unlimited number of servers.
Muhimbi