I need to convert and save the Html that is generated on the fly to pdf. Requirement is ,when user ckicks on the link ,next page has to be displayed on the user browser and a pdf copy of next page has to be saved on his/her machine.
I am not aware of free tools which can convert to HTML to PDF however couple of commerical softwares are available like BigFace, CORDA and PD4ML. Much better way will be to use Apache FOP. All you need to do is - Convert HTML to XHTML - Apply XSLT to create FO - Use Apache FOP to convert the FO to PDF
You can search at pdfzone.com and w3c.org under (XSL and XSLT)