The DocumentViewer for ASP.NET and Angular supports the completion of MS Word compatible form fields including text form fields, checkboxes, dropdowns and date picker fields. Form fields are available automatically when they are part of the document that is loaded into the DocumentViewer. Based on the Conditional Instructions , required fields can be validated.
Forms, that can be created in the TX Text Control editor, are deployed using the DocumentViewer that allows end-users to complete form fields. The completed data can be merged back into the document in order to create a PDF document or it is possible to extract the form data only. This is helpful, if the completed data should be used to write them back into a database or the form data should be analyzed.
This ASP.NET Core sample shows how to deploy a form and how to collect the resulting data. For demo purposes, all Deployments are stored in a simple JSON file server-side. After creating a new Deployment, the list of available deployments is updated:
The Deployment simply stores a user name (or id) and the available form fields:
After clicking on Open, the end-user's view is opened in a new tab:
After all fields have been completed, the form field values are posted back to the controller:
The controller method FormValues is deserializing the form field values and calls the helper method DeploymentHelpers.WriteValue:
The DeploymentHelpers.WriteValue method is writing the completed form field values into the Deployments data source:
Back in the overview, the posted values are now visible in the table:
You can test this sample on your own by downloading the project from our GitHub account.