TX Text Control provides a comprehensive way to create documents with fillable form elements such as form text boxes, check box fields and drop-down elements. Documents with form elements such as form text boxes, check box fields, drop-downs and date picker elements can be created like mail merge templates and dynamically pre-completed with known values. This helps to generate custom forms where some fields are already completed with known values to accelerate the completion process and to improve the user experience.
Using TX Text Control, PDF documents can be easily created, shared and collected in business applications. PDF forms with fillable form elements can be created and collected by reading the completed documents in order to analyze and store the data.
Creating the PDF Programmatically
This article shows how to create a PDF document with AcroForms that can be completed in document viewers such as Adobe Acrobat Reader. At least a trial version of TX Text Control .NET Server for ASP.NET is required for this tutorial.
In Visual Studio, create a new C# Console App (.NET Framework).
Select Add Reference... from the Project main menu. In the opened dialog, choose Browse... and browse for the TX Text Control assemblies TXTextControl.dll and TXTextControl.Server.dll from the TX Text Control installation folder (default: C:\Program Files\Text Control GmbH\TX Text Control 29.0.NET Server for ASP.NET\Assembly). Select both assemblies and confirm with Add. Close the dialog by clicking OK.
In the Solution Explorer, select Properties and choose Add New Item... from the Project main menu. Select Text File as the template, name it licenses.licx and confirm with Add.
Open the newly added file and add the following content:
TXTextControl.ServerTextControl, TXTextControl.Server, Culture=neutral, PublicKeyToken=6b83fe9a75cfb638
Set the Build Action property to Embedded Resource.
Add the following code to the Main method of the Program class to create a PDF with form fields programmatically from scratch:
After loading this document in Adobe Acrobat Reader, the document is recognized automatically as a form and users can complete the fields.
Creating Forms Visually
An easier way to create those documents is the usage of templates. Using the fully-featured UI of all TX Text Control platform products including ASP.NET (Core), Angular, Windows Forms and WPF, the documents can be visually created including the required form fields: