Click or drag to resize
Pdftools logo

SignerSign Method

Add a document signature

Document signatures are sometimes also called approval signatures. This type of signature lets you verify the integrity of the signed part of the document and authenticate the signer’s identity.

The features and format of the signature are defined by the Provider and the configuration.

Non-critical processing errors raise a Warning. It is recommended to review the WarningCategory and handle them if necessary for the application.


Namespace: PdfTools.Sign
Assembly: PdfTools (in PdfTools.dll) Version: 1.0.0
Syntax
C#
public Document Sign(
	Document document,
	SignatureConfiguration configuration,
	Stream stream,
	OutputOptions outputOptions = null
)

Parameters

document  Document
The input document to sign
configuration  SignatureConfiguration
The signature configuration
stream  Stream
The stream where the signed document is written
outputOptions  OutputOptions  (Optional)
Document-level output options not directly related to the signature

Return Value

Document
The signed document
Exceptions
ExceptionCondition
LicenseExceptionThe license check has failed.
IOExceptionWriting to the stream failed.
UnsupportedFeatureExceptionThe input PDF contains unrendered XFA form fields. See Xfa for more information on how to detect and handle XFA documents.
ArgumentExceptionIf the configuration is invalid, e.g. because the creating provider has been closed.
ArgumentExceptionIf the configuration is invalid, e.g. because it has been revoked.
NotFoundExceptionIf the FieldName does not exist in document.
RetryExceptionIf an unexpected error occurs that can be resolved by retrying the operation. For example, if a signature service returns an unexpectedly large signature.
RetryExceptionIf a resource required by the cryptographic provider is temporarily unavailable.
HttpExceptionIf a network error occurs, e.g. downloading revocation information (OCSP, CRL) or a time-stamp.
UnsupportedFeatureExceptionIf the cryptographic provider does not support the requested signing algorithm.
PermissionExceptionIf the cryptographic provider does not allow the signing operation.
ArgumentNullExceptionif document is .
ArgumentNullExceptionif configuration is .
ArgumentNullExceptionif stream is .
See Also