Products Technologies Demo Docs Blog Support Company

X19 Sneak Peek: Processing AcroForm Fields in Adobe PDF Documents

TX Text Control X19 will introduce a new namespace that contains classes to process PDF documents. A new feature allows the extraction of AcroForm fields from existing Adobe PDF documents.

X19 Sneak Peek: Processing AcroForm Fields in Adobe PDF Documents

In TX Text Control X19, the DocumentServer will be extended with a new namespace: TXTextControl.DocumentServer.PDF. This namespace is the new home for PDF specific tasks that doesn't require a connected Text Control.

Extracting Forms Data

Interactive forms in the Adobe PDF format are also known as AcroForm - the de-facto standard for PDF forms processing. The forms can be created and exported using TX Text Control, so that end-users can fill-out these form fields in Acrobat Reader or other applications.

A new feature of TX Text Control X19 allows the easy extraction of form field data to collect results from completed documents.

Import FormField Objects

The following code shows how to get all AcroForm fields from a physical PDF document using the GetAcroFormFields method that accepts file names and byte arrays:

FormField[] acroForms = 
    TXTextControl.DocumentServer.PDF.Forms.GetAcroFormFields("form.pdf");

foreach (FormField field in acroForms)
{ 
    switch (field)
    {
        case TXTextControl.DocumentServer.PDF.AcroForms.FormTextField textField:
            Console.WriteLine(textField.Value);
            break;

        case TXTextControl.DocumentServer.PDF.AcroForms.FormCheckBox checkBoxField:
            Console.WriteLine(checkBoxField.IsChecked);
            break;

        case TXTextControl.DocumentServer.PDF.AcroForms.FormComboBox comboBoxField:
            foreach(var item in comboBoxField.Options)
                Console.WriteLine(item);
            break;
    }
}

The return value is an array of FormField objects that contains all fields of the document:

Importing AcroForms fields

The above code shows how to loop through this array and to cast those types in a switch/case statement to get the proper values from those fields.

This new feature allows you to support the complete PDF forms workflow where TX Text Control can be used to:

  • Create PDF fillable form documents.
  • Share those documents.
  • Collect and analyze completed forms.

Stay tuned for more innovative document processing features of TX Text Control X19!

Stay in the loop!

Subscribe to the newsletter to receive the latest updates.

Related Posts

ASP.NETWindows FormsWPF

Extract Text and Data from PDF Documents in C#

TX Text Control can be used to create and edit Adobe PDF documents programmatically. But it is also possible to import PDF documents to read, extract and manipulate them. This article shows…


ASP.NETWindows FormsWPF

Creating PDF Files using TX Text Control .NET in C#

TX Text Control allows developers to create PDF files programmatically using C#. This article shows various ways to create Adobe PDF documents.


ASP.NETJavaScriptWindows Forms

Generating Interactive PDF Forms by Injecting JavaScript

Using TX Text Control, it is possible to export documents with form fields to fillable PDFs. This article shows how to inject JavaScript to add interaction to form fields.


ASP.NETWindows FormsWPF

Form Field Handling in PDF Documents

Since TX Text Control supports form fields, it is possible to either export form fields in the PDF document or to flatten the form fields to export text only without the field functionality. This…


ASP.NETWindows FormsWPF

Creating ZUGFeRD Compliant PDF Invoices in C#

ZUGFeRD / Factur-X documents can be created and extracted using TX Text Control X19. This article shows how to create a valid ZUGFeRD compliant invoice PDF document from scratch.