THPDFHeadlessDocument.AddSignatureField

function AddSignatureField(const Name: UnicodeString; PageIndex: Integer;
  const Rectangle: THPDFRectangle): Integer;

Creates a real terminal signature field and page widget, handing back its zero-based form-field index

Name must be a unique nonempty terminal name with no dots; PageIndex selects an existing indirect page and Rectangle supplies finite nonzero PDF coordinates

Rectangle coordinates are written as PDF numbers, including small positive and negative offsets

Existing AcroForm and annotation arrays keep their fields and widgets; documents without an AcroForm are given a new indirect AcroForm dictionary

Object, field, name, serialisation and aggregate output budgets are prepared before any graph changes; cancellation and rejected creation leave the original graph intact

Encrypted sources need annotation modification permission or owner authentication; new widgets cannot be added to a certified document

Use SetSignatureFieldAppearance for a visible caption, and SignToFile or SignPFXToFile for atomic signature publication