---
title: "Read PDF form fields | Nutrient .NET SDK"
canonical_url: "https://www.nutrient.io/guides/dotnet/forms/read-form-fields/"
md_url: "https://www.nutrient.io/guides/dotnet/forms/read-form-fields.md"
last_updated: "2026-05-21T17:12:02.203Z"
description: "Learn how to read and retrieve data from PDF form fields programmatically in C# .NET using Nutrient .NET SDK. Access form field values within your applications."
---

# Read PDF form fields in C# .NET

To read a form field’s data in a PDF document, use one of the methods starting with the `GetFormField` prefix. All these methods require the form field ID as their parameter. The list below contains the most commonly used methods:

- [`GetFormFieldType`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~GetFormFieldType.html)

- [`GetFormFieldValue`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~GetFormFieldValue.html)

- [`GetFormFieldLocation`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~GetFormFieldLocation.html)

- [`GetFormFieldFontSize`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~GetFormFieldFontSize.html)

The following example finds all text form fields in a document and prints their content to the console:

### C#

```csharp

using GdPicturePDF gdpicturePDF = new GdPicturePDF();
gdpicturePDF.LoadFromFile(@"C:\temp\source.pdf");
// Determine the number of form fields.
int fieldCount = gdpicturePDF.GetFormFieldsCount();
// Loop through all form fields.
for (int i = 0; i < fieldCount; i++)
{
    // Get the field ID of each form field.
    int fieldID = gdpicturePDF.GetFormFieldId(i);
    // Check if the current field is a text box.
    if (gdpicturePDF.GetFormFieldType(fieldID) == PdfFormFieldType.PdfFormFieldTypeText)
    {
        // Get the current form field's value and print it to the console.
        string fieldValue = gdpicturePDF.GetFormFieldValue(fieldID);
        Console.WriteLine(fieldValue);
    }
}

```

### VB.NET

```vb

Using gdpicturePDF As GdPicturePDF = New GdPicturePDF()
    gdpicturePDF.LoadFromFile("C:\temp\source.pdf")
    ' Determine the number of form fields.
    Dim fieldCount As Integer = gdpicturePDF.GetFormFieldsCount()
    ' Loop through all form fields.
    For i = 0 To fieldCount - 1
        ' Get the field ID of each form field.
        Dim fieldID As Integer = gdpicturePDF.GetFormFieldId(i)
        ' Check if the current field is of text box type.
        If gdpicturePDF.GetFormFieldType(fieldID) Is PdfFormFieldType.PdfFormFieldTypeText Then
            ' Get the current form field's value and print it to the console.
            Dim fieldValue As String = gdpicturePDF.GetFormFieldValue(fieldID)
            Console.WriteLine(fieldValue)
        End If
    Next
End Using

```

#### Used methods

- [`GetFormFieldId`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~GetFormFieldId.html)

- [`GetFormFieldsCount`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~GetFormFieldsCount.html)

- [`GetFormFieldType`]

- [`GetFormFieldValue`]

- [`LoadFromFile`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~LoadFromFile.html)

#### Related topics

- [Load a file](/guides/dotnet/load-a-file.md)
---

## Related pages

- [Flatten PDF form fields in C# .NET](/guides/dotnet/forms/flatten.md)
- [Extract data from PDF form fields in C# .NET](/guides/dotnet/forms/extract-form-data.md)
- [PDF forms in C#.NET](/guides/dotnet/forms.md)
- [PDF form field items in C# .NET](/guides/dotnet/forms/form-field-items.md)
- [Introduction to PDF forms in C#](/guides/dotnet/forms/introduction-what-are-forms.md)
- [Introduction to PDF form fields in C#](/guides/dotnet/forms/introduction-form-fields.md)
- [Add PDF actions to forms using C#](/guides/dotnet/forms/pdf-actions-support.md)

