Signature
Provides functionality for signing PDF documents. Supports both digital signatures (with certificate) and electronic signatures (visual only).
The class enables adding signatures to PDF documents: Digital signatures use PFX/P12 certificates to cryptographically sign the document.Electronic signatures add visual representation (image/text) without cryptographic signing. For PAdES-B compliance, use CAdES signature mode (the default). For PAdES-T compliance, configure a in the signature options.
from nutrient_sdk import SignatureMethods
sign
def sign(self, document: Document, output_path: str, options: DigitalSignatureOptions) -> NoneApplies an invisible digital signature to a document.
Parameters:
| Name | Type | Description |
|---|---|---|
document | Document | The document to sign. |
output_path | str | The path where the signed PDF will be saved. |
options | DigitalSignatureOptions | The digital signature options including certificate and metadata. |
sign_field
def sign_field(self, document: Document, output_path: str, field_name: str, options: DigitalSignatureOptions, appearance: SignatureAppearance) -> NoneApplies a signature to a document using an existing signature field. Supports both digital signatures (with certificate) and electronic signatures (visual only).
Parameters:
| Name | Type | Description |
|---|---|---|
document | Document | The document to sign. |
output_path | str | The path where the signed PDF will be saved. |
field_name | str | The name of the existing signature form field to use for the signature. |
options | DigitalSignatureOptions | The digital signature options. Can be null for electronic signatures. |
appearance | SignatureAppearance | The visual appearance of the signature. |