Live signature field API
Insert, inspect, and complete signature fields
Create a signing location with suggested signer data, select it in the document, and compare three ways to complete the signing workflow.
2
Select a signature fieldClick the field in the document to unlock its metadata and completion actions.
Selected signature field
Signature field
Empty field
Suggested signatureNo suggested signer
Text position-
Frame size-
Placement-
Object ID-
Signature fields in this text part
0 fields
Reading the signature field collection...
Ready to tryUse the controls above to interact with this demo.
What this demonstrates
One document object supports several signing workflows
A signature field is a positioned document object with suggested signer metadata. It can display a handwritten signature image, remain interactive in an exported PDF, or identify the exact location for a certificate-backed server signature.
Field collection
TXTextControl.signatureFields
Anchored insertion
SignatureFieldCollection.addAnchored
Signer metadata
SignatureField.getSignerData / setSignerData
Digital export
SaveSettings.SignatureFields
How it works
SignatureFieldCollection.addAnchored inserts the field at the current input position when its textPosition argument is -1. The size is specified in twips, the horizontal alignment is centered, and FrameInsertionMode.AboveTheText lets surrounding text flow around the anchored object.
The returned SignatureField inherits layout members from FrameBase. The inspector reads getName, getTextPosition, getSize, and getInsertionMode, while getSignerData returns the suggested signer's name, title, address, contact information, and signing reason.
The signatureFieldSelected and signatureFieldDeselected events are the only source of truth for enabling field-specific actions. This avoids relying on focus timing while the user moves between the editor and the Try It panel.
For server-side signing, the document is loaded into ServerTextControl. Each field receives a unique name and a DigitalSignature backed by an exportable X509Certificate2. Passing those signatures through SaveSettings.SignatureFields binds the certificate signatures to their document fields during PDF creation.
TXTextControl.signatureFields.addAnchored(
{ width: 3600, height: 1200 },
TXTextControl.HorizontalAlignment.Center,
-1,
TXTextControl.FrameInsertionMode.AboveTheText,
field => field.setSignerData({
name: "Alex Morgan",
title: "Approver",
reason: "Document approval",
address: "",
contactInfo: ""
}));
using var certificate = X509CertificateLoader.LoadPkcs12(
System.IO.File.ReadAllBytes(certificatePath),
password,
X509KeyStorageFlags.MachineKeySet |
X509KeyStorageFlags.Exportable);
var settings = new SaveSettings {
SignatureFields = signatures.ToArray()
};
textControl.Save(out var pdf,
BinaryStreamType.AdobePDF,
settings);
NuGet packages
TXTextControl.TextControl.Core.SDK
34.0.4
Provides the core document model and server-side document processing APIs.
dotnet add package TXTextControl.TextControl.Core.SDK --version 34.0.4
Provides the browser-based TX Text Control document editor and JavaScript API.
dotnet add package TXTextControl.Web --version 34.4.0
TXTextControl.Web.DocumentEditor.Backend
34.4.0
Hosts the WebSocket-based backend used by the browser document editor.
dotnet add package TXTextControl.Web.DocumentEditor.Backend --version 34.4.0