---
title: "Remove form fields from PDF in C# .NET | Nutrient .NET SDK"
canonical_url: "https://www.nutrient.io/guides/dotnet/forms/create-edit-and-remove/remove-fields/"
md_url: "https://www.nutrient.io/guides/dotnet/forms/create-edit-and-remove/remove-fields.md"
last_updated: "2026-05-14T21:57:26.864Z"
description: "Learn how to remove form fields from PDF documents programmatically in C# .NET using Nutrient .NET SDK. Delete unwanted fields from your interactive forms."
---

# Remove form fields from PDFs in C# .NET

Nutrient.NET SDK (formerly GdPicture.NET) enables you to delete either single form fields or all form fields in a specified PDF document.

## Removing a single form field

To remove a single form field, use the [`RemoveFormField` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~RemoveFormField.html). It requires only the field ID you want to delete as its parameter. To get the form field’s ID, refer to the [get field ID](https://www.nutrient.io/guides/dotnet/forms/create-edit-and-remove/get-field-id.md) guide.

To remove all text box form fields, use the following code:

### C#

```csharp

using GdPicturePDF gdpicturePDF = new GdPicturePDF();
gdpicturePDF.LoadFromFile(@"C:\temp\source.pdf");
// Get the form field count.
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 of the text box type.
    if (gdpicturePDF.GetFormFieldType(fieldID) == PdfFormFieldType.PdfFormFieldTypeText)
    {
        // Remove the text box field.
        gdpicturePDF.RemoveFormField(fieldID);
    }
}
gdpicturePDF.SaveToFile(@"C:\temp\output.pdf");

```

### VB.NET

```vb

Using gdpicturePDF As GdPicturePDF = New GdPicturePDF()
    gdpicturePDF.LoadFromFile("C:\temp\source.pdf")
    ' Get the form field count.
    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 the text box type.
        If gdpicturePDF.GetFormFieldType(fieldID) Is PdfFormFieldType.PdfFormFieldTypeText Then
            ' Remove the text box field.
            gdpicturePDF.RemoveFormField(fieldID)
        End If
    Next

    gdpicturePDF.SaveToFile("C:\temp\output.pdf")
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`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~GetFormFieldType.html)

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

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

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

#### Related Topics

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

- [Save a File](/guides/dotnet/save-a-file.md)

For detailed information about how to get the form field ID, refer to the [get field ID] guide.

## Removing all form fields

To remove all form fields in a PDF document, use the [`RemoveFormFields` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~RemoveFormFields.html):

### C#

```csharp

using GdPicturePDF gdpicturePDF = new GdPicturePDF();
gdpicturePDF.LoadFromFile(@"C:\temp\source.pdf");
gdpicturePDF.RemoveFormFields();
gdpicturePDF.SaveToFile(@"C:\temp\output.pdf");

```

### VB.NET

```vb

Using gdpicturePDF As GdPicturePDF = New GdPicturePDF()
    gdpicturePDF.LoadFromFile("C:\temp\source.pdf")
    gdpicturePDF.RemoveFormFields()
    gdpicturePDF.SaveToFile("C:\temp\output.pdf")
End Using

```

#### Used Methods

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

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

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

#### Related Topics

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

- [Save a File](/guides/dotnet/save-a-file.md)
---

## Related pages

- [Get the PDF form field ID in C# .NET](/guides/dotnet/forms/create-edit-and-remove/get-field-id.md)
- [Edit PDF form fields in C# .NET](/guides/dotnet/forms/create-edit-and-remove/edit-fields.md)
- [Add a signature field in PDF](/guides/dotnet/forms/create-edit-and-remove/add-signature-field.md)
- [Create a fillable PDF form in C# .NET](/guides/dotnet/forms/create-edit-and-remove/create-fillable-form.md)

