The question in not really clear: the servlet does not convert anything. The servlet "composes" the response and this response can be HTML, PDF or any other MIME format.
The conversion you need can be done with multiple libraries but instead of a servlet...
what about a filter that converts the output of an HTML response (maybe prepared by a JSP)??
It's only an idea
Joined: Jun 05, 2010
Actually, my requirement is that i have to provide a pdf cnversion facility in Formulae.html(mathematics). That html is just informative. If the user clicks pdf conversion link, it will cnverts the contents of html into pdf.