---
title: "Add a signature field in PDF | Nutrient .NET SDK"
canonical_url: "https://www.nutrient.io/guides/dotnet/forms/create-edit-and-remove/add-signature-field/"
md_url: "https://www.nutrient.io/guides/dotnet/forms/create-edit-and-remove/add-signature-field.md"
last_updated: "2026-05-21T17:12:02.203Z"
description: "Learn how to add signature fields to PDF documents programmatically in C# .NET using Nutrient .NET SDK. Implement digital signature functionality in your applications."
---

# Add a signature field in PDF

To add a signature form field that’s later used for digital signing, follow these steps:

1. Load the source document by passing its path to the [`LoadFromFile` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~LoadFromFile.html) of the [`GdPicturePDF` object](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF.html).

2. 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).

3. Set the [measurement unit](https://www.nutrient.io/guides/dotnet/editor/add-text-to-pdf.md) used to specify dimensions.

4. Add the signature field with the [`AddSignatureFormField` method](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~AddSignatureFormField.html). It uses the following parameters:
   - `Left` — The horizontal distance between the closest point to the defined origin point.
   - `Top` — The vertical distance between the closest point to the defined origin point.
   - `Width` — The width of the signature field’s bounding box.
   - `Height` — The height of the signature field’s bounding box.
   - `FieldName` — The name of the signature field used for identifying form fields.

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

6. 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).

To add a signature form field that’s later used for digital signing, use the following code:

### C#

```csharp

using GdPicturePDF gdPicturePDF = new GdPicturePDF();
gdPicturePDF.LoadFromFile(@"C:\temp\source.pdf");
// Select the second page of the PDF document.
gdPicturePDF.SelectPage(1);
// Set the measurement unit to centimeters.
gdPicturePDF.SetMeasurementUnit(PdfMeasurementUnit.PdfMeasurementUnitCentimeter);
// Set the origin of the coordinate system to the bottom-right corner.
gdPicturePDF.SetOrigin(PdfOrigin.PdfOriginBottomRight);
// Add the `Signature1` signature field.
int signatureField = gdPicturePDF.AddSignatureFormField(2, 5, 5, 2, "Signature1");
// Set the font type to Freestyle Script.
string fontName = gdPicturePDF.AddTrueTypeFont("Freestyle Script", false, false, false);
gdPicturePDF.SetFormFieldFontResName(signatureField, fontName);
// Set the font size to 48 points.
gdPicturePDF.SetFormFieldFontSize(signatureField, 48);
// Set the font color to blue.
gdPicturePDF.SetFormFieldFontColor(signatureField, 0, 0, 255);
// Set the text alignment to center.
gdPicturePDF.SetFormFieldTextAlignment(signatureField, TextAlignment.TextAlignmentCenter);
// Save the PDF document to a file.
gdPicturePDF.SaveToFile(@"C:\temp\output.pdf");

```

### VB.NET

```vb

Using gdPicturePDF As GdPicturePDF = New GdPicturePDF()
    gdPicturePDF.LoadFromFile("C:\temp\source.pdf")
    ' Select the second page of the PDF document.
    gdPicturePDF.SelectPage(1)
    ' Set the measurement unit to centimeters.
    gdPicturePDF.SetMeasurementUnit(PdfMeasurementUnit.PdfMeasurementUnitCentimeter)
    ' Set the origin of the coordinate system to the bottom-right corner.
    gdPicturePDF.SetOrigin(PdfOrigin.PdfOriginBottomRight)
    ' Add the `Signature1` signature field.
    Dim signatureField As Integer = gdPicturePDF.AddSignatureFormField(2, 5, 5, 2, "Signature1")
    ' Set the font type to Freestyle Script.
    Dim fontName As String = gdPicturePDF.AddTrueTypeFont("Freestyle Script", False, False, False)
    gdPicturePDF.SetFormFieldFontResName(signatureField, fontName)
    ' Set the font size to 48 points.
    gdPicturePDF.SetFormFieldFontSize(signatureField, 48)
    ' Set the font color to blue.
    gdPicturePDF.SetFormFieldFontColor(signatureField, 0, 0, 255)
    ' Set the text alignment to center.
    gdPicturePDF.SetFormFieldTextAlignment(signatureField, TextAlignment.TextAlignmentCenter)
    ' Save the PDF document to a file.
    gdPicturePDF.SaveToFile("C:\temp\output.pdf")
End Using

```

#### Used methods

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

- [`AddTrueTypeFont`]

- [`LoadFromFile`](https://www.nutrient.io/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)

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

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

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

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

- [`SetMeasurementUnit`](/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, or 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.

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 method enables you to load 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 text is set to bold font.
  - `Italic` — A Boolean value that specifies if the text is set to italic font.
  - `Embedded` — A Boolean value that specifies if the text is embedded.

- [`AddTrueTypeFontFromFile`](https://www.nutrient.io/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~AddTrueTypeFontFromFile.html) — This method enables you to load 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 texts significantly increase 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 requires 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 requires the following parameters:

- `FieldId` — A unique form field ID.

- Color defined 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 requires 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

- [Create a fillable PDF form in C# .NET](/guides/dotnet/forms/create-edit-and-remove/create-fillable-form.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)

