---
title: "Create fillable PDF form in C# .NET | Nutrient .NET SDK"
canonical_url: "https://www.nutrient.io/guides/dotnet/forms/create-edit-and-remove/create-fillable-form/"
md_url: "https://www.nutrient.io/guides/dotnet/forms/create-edit-and-remove/create-fillable-form.md"
last_updated: "2026-05-21T17:12:02.203Z"
description: "Learn how to create fillable PDF forms programmatically in C# .NET using Nutrient .NET SDK. Generate interactive forms with various field types."
---

# Create a fillable PDF form in C# .NET

To add a fillable form to a PDF, follow the steps below:

1. Create a `GdPicturePDF` object.

2. Load the PDF file with the [`LoadFromFile` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14~GdPicture14.GdPicturePDF~LoadFromFile.html).

3. Set the origin of the coordinate system with the [`SetOrigin` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~SetOrigin.html). This method requires the [`PDFOrigin` enumeration](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.PdfOrigin.html).

4. Set the measurement unit with the [`SetMeasurementUnit` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~SetMeasurementUnit.html) to specify the form field’s dimensions and position. This method uses the [`PdfMeasurementUnit` enumeration](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.PdfMeasurementUnit.html).

5. Select the PDF page where you want to place the form field using the [`SelectPage` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~SelectPage.html).

6. Add a form field. By default, all form field types are fillable.

7. Optional: Specify the font configuration. For more information, refer to the [Text Settings in Form Fields](#text-settings-in-form-fields) section.

8. Save the PDF document to a file with the [`SaveToFile` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~SaveToFile.html).

All methods that add a new form field return an integer value, which is the field ID. Recommended: Save the field ID to a variable so that you can later reference the field.

### C#

```csharp

using GdPicturePDF gdpicturePDF = new GdPicturePDF();
gdpicturePDF.LoadFromFile(@"C:\temp\source.pdf");
// Set the origin of the coordinate system.
gdpicturePDF.SetOrigin(PdfOrigin.PdfOriginTopLeft);
// Set the measurement unit to centimeters.
gdpicturePDF.SetMeasurementUnit(PdfMeasurementUnit.PdfMeasurementUnitCentimeter);
// Select the first PDF page.
gdpicturePDF.SelectPage(1);
// Add the text form field and save its ID as an integer.
int formID = gdpicturePDF.AddTextFormField(1, 2, 8, 3, "TextField1", "", true, "", 12, 0, 0, 255);
gdpicturePDF.SaveToFile(@"C:\temp\output.pdf");

```

### VB.NET

```vb

Using gdPicturePDF As GdPicturePDF = New GdPicturePDF()
    gdpicturePDF.LoadFromFile("C:\temp\source.pdf")
    ' Set the origin of the coordinate system.
    gdpicturePDF.SetOrigin(PdfOrigin.PdfOriginTopLeft)
    ' Set the measurement unit to centimeters.
    gdpicturePDF.SetMeasurementUnit(PdfMeasurementUnit.PdfMeasurementUnitCentimeter)
    ' Select the first PDF page.
    gdpicturePDF.SelectPage(1)
    ' Add the text form field and save its ID as an integer.
    Dim formID As Integer = gdpicturePDF.AddTextFormField(1, 2, 8, 3, "TextField1", "", True, "", 12, 0, 0, 255)
    gdpicturePDF.SaveToFile("C:\temp\output.pdf")
End Using

```

#### Used methods

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

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

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

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

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

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

#### Related topics

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

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

## Text settings in form fields

This section explains how to configure text settings such as font type, color, and size.

### Font type

To specify the text font, use the [`SetFormFieldFontResName` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~SetFormFieldFontResName.html). It requires the following parameters:

- `FieldId` — A unique form field ID.

- `FontResName` — A string value of the text font.

You can define the `FontResName` parameter with one of the following methods:

- [`AddStandardFont`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~AddStandardFont.html) — This method requires the [`PdfStandardFont` enumeration](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.PdfStandardFont.html) as its parameter.

- [`AddTrueTypeFont`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~AddTrueTypeFont.html) — This enables loading any font format used in your operating system and uses the following parameters:
  - `FontName` — The name of the font as a string value.
  - `Bold` — A Boolean value that specifies if the loaded font is bold.
  - `Italic` — A Boolean value that specifies if the loaded font is italic.
  - `Embedded` — A Boolean value that specifies if the loaded font is embedded.

- [`AddTrueTypeFontFromFile`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~AddTrueTypeFontFromFile.html) — This enables loading a TrueType or OpenType font from a file.

- [`AddTrueTypeFontU`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~AddTrueTypeFontU.html) — This method adds a TrueType or OpenType font with Unicode character support.

- [`AddTrueTypeFontFromFileU`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~AddTrueTypeFontFromFileU.html) — This method adds a TrueType or OpenType font from a file with Unicode character support.

Embedded text significantly increases the file size.

### Font size

To specify the text size, use the [`SetFormFieldFontSize` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~SetFormFieldFontSize.html). It uses the following parameters:

- `FieldId` — A unique form field ID.

- `FontSize` — The text size expressed in points (pt).

### Font color

To specify the text color, use the [`SetFormFieldFontColor` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~SetFormFieldFontColor.html). It uses the following parameters:

- `FieldId` — A unique form field ID.

- Color definition — You can define the color in one of the following ways:
  - A set of three `Byte` parameters that specify the RGB color model.
  - A set of four `Byte` parameters that specify the CMYK color model.
  - A [`GdPictureColor` object](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.Imaging.GdPictureColor.html).

### Text alignment

To specify the text alignment, use the [`SetFormFieldTextAlignment` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~SetFormFieldTextAlignment.html). It uses the following parameters:

- `FieldId` — A unique form field ID.

- `TextAlign` — A member of the [`TextAlignment` enumeration](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.TextAlignment.html) that specifies the text alignment.
---

## Related pages

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

