Add electronic signatures to PDFs in Windows

This guide explains how to add an electronic signature (eSignature) to a PDF document on Windows using Nutrient UWP SDK, both through the built-in user interface (UI) and programmatically.

Adding an electronic signature programmatically

In Nutrient UWP SDK, electronic signatures are implemented as PDF annotations, commonly referred to as signature annotations.

Electronic signatures can be either ink or image annotations, created with:

To add an eSignature:

  1. Set the IsSignature property to true.

  2. Add the annotation using CreateAnnotationAsync.

Licensing requirements for signature annotations

Creating, updating, and deleting signature annotations requires a license that includes either the Annotations component or the Electronic Signatures component. If your license includes only the Electronic Signatures component (without the Annotations component), modifications are restricted to signature annotations exclusively. Any attempt to modify non-signature ink or image annotations (isSignature = false) or other annotation types will be disallowed.

Creating an ink signature

To create an ink signature programmatically, use to the following code snippet:

var annotation = new Ink
{
    PageIndex = 0,
    IsSignature = true,
    Lines = new List<IList<DrawingPoint>>
    {
        new List<DrawingPoint>
        {
            new DrawingPoint(x: 5, y: 5),
            new DrawingPoint(x: 95, y: 95)
        },
        new List<DrawingPoint>
        {
            new DrawingPoint(x: 95, y: 5),
            new DrawingPoint(x: 5, y: 95)
        }
    },
    BoundingBox = new Rect(
        x: 0,
        y: 0,
        width: 100,
        height: 100
    )
};

await PdfView.Controller.CreateAnnotationAsync(annotation);

Creating an image signature

To create an image signature programmatically, use to the following code snippet:

// Read the image in a buffer.
var buffer = await FileIO.ReadBufferAsync(file);

// Create an annotation attachment for the image in the document.
var attachment = await PdfView.Document.CreateAttachmentAsync(buffer, file.ContentType);

// Create the annotation template and set the image attachment ID and the content type.
var annotation = new Image
{
    PageIndex = 0
    IsSignature = true,
    // In this case, "image/png".
    ContentType = file.ContentType,
    ImageAttachmentId = attachment,
    Description = "Signature Image",
    BoundingBox = new Rect(100, 100, 100, 100),
};

await PDFView.Controller.CreateAnnotationAsync(annotation);

Using the built-in UI

If you’re using the SDK with Forms, end users can initiate the signature creation modal by tapping a signature form field within the document. If no signature form field is present, end users can manually add a signature using the signature tool button.

The signature tool button is available in the toolbar for quick access.

Screenshot of Nutrient UWP SDK toolbar with the sign button highlighted.

Signature creation modal view

When the signature creation modal view is displayed, end users can add a signature using one of three methods:

  • Draw — End users can create a handwritten signature using a touchscreen or stylus. This method is particularly effective when using devices such as Surface Pen.

  • Attach an image — End users can attach an existing signature image from their device.

  • Type — End users can enter their signature as text using a chosen font style.

End users can attach an existing signature image from their device. If the hardware supports it, they can also capture a photo of their handwritten signature on paper for a digital scan. This option is ideal when signing on a device with easy access to stored files.

End users can enter their name and select from a predefined set of font-based signature styles. This method ensures accessibility and is fully compatible with:

  • Screen readers such as VoiceOver, TalkBack, NVDA, and JAWS.

  • Assistive technologies such as Switch Control on Mac and iOS.

By default, Nutrient provides four signature styles, and you can customize the available options by defining a list of preferred fonts.

Color options

For both the Draw and Type options, end users can choose between black and two shades of blue to ensure the signature remains distinguishable from the document background.