# Forms.GetAcroFormFields Method

> Imports AcroFormFields from an Adobe PDF document.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 29.0
- **Namespace:** `TXTextControl.DocumentServer.PDF`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXDocumentServer.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXDocumentServer.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl.DocumentServer.PDF > Forms.GetAcroFormFields Method
- **755 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-pdf/forms/getacroformfields-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-pdf/forms/getacroformfields-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-pdf/forms/getacroformfields-method/llms-full.txt

---

### Description

Imports AcroFormFields from an Adobe PDF document.

### Syntax

#### GetAcroFormFields(string)

Return the imported AcroFormField objects from a file.

```csharp
public static FormField[] GetAcroFormFields(string filename);
```

```vbnet
Public Function GetAcroFormFields(filename As String) As FormField()
```

| Parameter | Description |
|---|---|
| filename | Specifies the complete file path of the PDF document. |

#### GetAcroFormFields(byte\[\])

Return the imported AcroFormField objects from a byte array.

```csharp
public static FormField[] GetAcroFormFields(byte[] data);
```

```vbnet
Public Function GetAcroFormFields(data As Byte()) As FormField()
```

| Parameter | Description |
|---|---|
| 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.

```csharp
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);
}
```

```vbnet
Dim results As TXTextControl.DocumentServer.PDF.AcroForms.FormField() = TXTextControl.DocumentServer.PDF.Forms.GetAcroFormFields("document.docx")
For Each formField As TXTextControl.DocumentServer.PDF.AcroForms.FormField In results
    Console.WriteLine(formField)
Next
```

---

## Nearby

- **Previous:** [Forms Class](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-pdf/forms/llms-full.txt)
- **Next:** [TXTextControl.DocumentServer.WPF namespace](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-documentserver-wpf/llms-full.txt)
