Click or drag to resize
Pdftools logo

SignerAddPreparedSignature Method

Add a prepared signature

Adding a prepared signature is only required in very particular or specialized use cases. This method is the same as Sign(Document, SignatureConfiguration, Stream, OutputOptions), but without actually creating the cryptographic signature. The cryptographic signature can be inserted later using SignPreparedSignature(Document, SignatureConfiguration, Stream).

While the configuration can be created by any Provider, it is typically created by CreatePreparedSignature(Int32, String, String).


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

Parameters

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

Return Value

PreparedDocument
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
NotFoundExceptionIf the FieldName does not exist in document.
UnsupportedFeatureExceptionIf the cryptographic provider does not support the requested signing algorithm.
HttpExceptionIf a network error occurs, e.g. downloading revocation information (OCSP, CRL).
ArgumentNullExceptionif document is .
ArgumentNullExceptionif configuration is .
ArgumentNullExceptionif stream is .
See Also