subject: How To Convert Html Form Data To Pdf With Hiqpdf Html To Pdf .net Library [print this page] This article presents the solution for the following scenario:
Let's say you have filled some values in a HTML form of a web page and you want to convert this web page to PDF preserving the values filled in the form and the ASP.NET Session Data.
In order to capture the values filled in the ASP.NET page, you have to override the Render method of the ASP.NET page to get the HTML code that would be generated during Render phase of the page processing and convert that HTML code to PDF passing the page URL as base URL parameter to the converter.
When a 'Convert This Page to PDF' button in the page is pressed, the convertCrtPageToPdf boolean field is set to true.
This field is checked in the overridden Render method and if it is true then the HTML code is captured, converted to PDF and the generated PDF is sent as response to browser instead of the normal HTML.