THPDFHeadlessDocument.AddSignatureField

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

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

Name must be a unique nonempty terminal name without 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 retain their fields and widgets; documents without an AcroForm receive a new indirect AcroForm dictionary

Object, field, name, serialization, and aggregate output budgets are prepared before graph changes; cancellation and rejected creation preserve the original graph

Encrypted sources require 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