sign

public final void sign(Document document, String outputPath, DigitalSignatureOptions options)

Applies an invisible digital signature to a document. An invisible signature adds cryptographic proof of authenticity without any visual representation on the document pages. The signature can be verified in PDF viewers that support digital signatures. 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. If the document was opened with a password through its open settings, that password is applied automatically so password-protected PDFs can be signed.

Parameters

document

The document to sign.

outputPath

The path where the signed PDF will be saved.

options

The digital signature options including certificate and metadata.


public final void sign(Document document, FileOutputStream output, DigitalSignatureOptions options)

Applies an invisible digital signature to a document, writing the result to a stream. An invisible signature adds cryptographic proof of authenticity without any visual representation on the document pages. The signature can be verified in PDF viewers that support digital signatures. 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. If the document was opened with a password through its open settings, that password is applied automatically so password-protected PDFs can be signed.

Parameters

document

The document to sign.

output

The output stream where the signed PDF will be written.

options

The digital signature options including certificate and metadata.