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.7.0+cfcc11b476b3e1eb4320f0f37269191f64e36bd8
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.
NotFoundExceptionIf an image, a PDF or a font file for the visual appearance could not be found.
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