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:

Creating documents with TX Text Control

The Deployment simply stores a user name (or id) and the available form fields:

Loading...

The FormField model contains the Name, Type and Value and is returned by the forms.getValues JavaScript method of the DocumentViewer:

Loading...

After clicking on Open, the end-user's view is opened in a new tab:

Creating documents with TX Text Control

After all fields have been completed, the form field values are posted back to the controller:

Loading...

The controller method FormValues is deserializing the form field values and calls the helper method DeploymentHelpers.WriteValue:

Loading...

The DeploymentHelpers.WriteValue method is writing the completed form field values into the Deployments data source:

Loading...

Back in the overview, the posted values are now visible in the table:

Creating documents with TX Text Control

You can test this sample on your own by downloading the project from our GitHub account.