Free Support Forum -

Best way to print/save a filled html-form as pdf on postback

I have a C# ASP.NET MVC application where a html form is displayed to the user. The user should fill the form and click on the submit button.

When the user clicks on the sumbit button, a PDF-version of the filled form should be generated for documentation purposes. (similar to a “print to pdf”-function).
The HTML-Form-Fields should be flattened, so that the genrated PDF is a flat file and not a fillable PDF-Form)
What is the best way to do this inside a MVC-Controller?


Once the HTML form is filled, you can obtain the page HTML source and convert it into PDF using Aspose.HTML in the code behind. Please check the below article to convert HTML to PDF:

In case you face any issue, please feel free to let us know by sharing your sample HTML file in a .zip format. We will test the scenario in our environment and address it accordingly.