signField

public final void signField(Document document, String outputPath, String fieldName, DigitalSignatureOptions options, SignatureAppearance appearance)

Applies a signature to a document using an existing signature field. Supports both digital signatures (with certificate) and electronic signatures (visual only). The behavior depends on what is provided:Certificate + Appearance: Digital signature with custom visual appearance.Certificate only: Digital signature with auto-generated appearance from metadata.Appearance only: Electronic signature (visual only, field is replaced with image/text).Neither: Throws ArgumentException. If the document is not in PDF format and implicit conversion is enabled in the document settings, it will be automatically converted to PDF before signing.

Parameters

document

The document to sign.

outputPath

The path where the signed PDF will be saved.

fieldName

The name of the existing signature form field to use for the signature.

options

The digital signature options. Can be null for electronic signatures.

appearance

The visual appearance of the signature.