TX Text Control .NET Server

GetAcroFormFields Method

Method|Introduced in 29.0
Namespace
TXTextControl.DocumentServer.PDF
Package
TXTextControl.TextControl.Core.SDK as TXDocumentServer.Core.dll from the private NuGet feed or Text Control Offline Packages
Also in
TXTextControl.TextControl.ASP.SDK as TXDocumentServer.dll

Description

Imports AcroFormFields from an Adobe PDF document.

Syntax

GetAcroFormFields(string)

Return the imported AcroFormField objects from a file.

public static FormField[] GetAcroFormFields(string filename);
ParameterDescription
filename

Specifies the complete file path of the PDF document.

GetAcroFormFields(byte[])

Return the imported AcroFormField objects from a byte array.

public static FormField[] GetAcroFormFields(byte[] data);
ParameterDescription
data

Specifies the byte array of the PDF document.

Return Value

Returns an array of FormField objects.

Examples

The following example retrieves acro form fields from the forms.

TXTextControl.DocumentServer.PDF.AcroForms.FormField[] results = TXTextControl.DocumentServer.PDF.Forms.GetAcroFormFields("document.docx");
foreach (TXTextControl.DocumentServer.PDF.AcroForms.FormField formField in results)
{
    Console.WriteLine(formField);
}

Further Reading

  • Create, Pre-Select, Flatten and Extract PDF Form Fields using C# –
  • Extract Text and Data from PDF Documents in C# –
  • Importing Form Data from PDF Documents Exported from Chrome –