TX Text Control provides a sophisticated way to create and deploy forms using the online editor and document viewer. Existing forms with form text fields, checkboxes, drop-downs and date picker fields can be imported from MS Word or created using TX Text Control:
This form can be deployed using the TX Text Control DocumentViewer that shows the form fields automatically including conditional instructions:
Convert to HTML Forms
The DocumentViewer is responsive and supports mobile devices as well, but sometimes a pure HTML form is the better option to request data from users. Specifically, if the completed data should be collected on mobile devices. The advantage of TX Text Control is the integration into a complete workflow:
- Maintain one master form template
- Extract form fields
- Merge data into master template
- Create final PDF from merged data and the template
The following illustration shows this workflow in detail:
In this sample, all form fields are converted into HTML form elements. A Sub
╰ SubTextPart Object
A SubTextPart object represents a user-defined part of a document. object is used as a structural element to group specific form fields.
Creating Form Groups
On clicking Convert to HTML Form, the document is being saved and sent to the Controller method CreateForm:
The Controller method loads the document into a Server
╰ TXTextControl Namespace
╰ ServerTextControl Class
The ServerTextControl class implements a component that provide high-level text processing features for server-based applications. in order to loop through all SubTextParts.
Each section (SubTextPart) is saved and processed individually to extract the form fields:
Create HTML Form Fields Client-Side
Finally, a list of SmartFormField objects is returned. These objects contain the required information to create the HTML form client-side:
You can download the full sample from our GitHub repository to test this on your own.