PdfStreamSigner
Applies a digital signature to an existing PDF using incremental update, avoiding a full file rewrite.
Definition
Namespace:Telerik.Documents.Fixed.FormatProviders.Pdf.Streaming
Assembly:Telerik.Windows.Documents.Fixed.dll
Syntax:
public class PdfStreamSigner
Inheritance: objectPdfStreamSigner
Constructors
Creates a signer that writes the signed PDF to the specified outputStream.
public PdfStreamSigner(Stream outputStream)
The output stream where the signed document will be written.
Methods
Signs the PDF from originalStream, places signatureField on pageIndex, and writes the signed result to the configured output stream.
public void SignDocument(Stream originalStream, SignatureField signatureField, int pageIndex, TimeSpan? timeout)
The original PDF document stream.
signatureFieldSignatureFieldThe signature field to be added to the document.
pageIndexintThe index of the page where the signature will be added.
timeoutTimeSpan?The timeout for the operation.
Exceptions: ArgumentNullExceptionThrown when signatureField is null or does not contain a signature.
Thrown when the signature field contains no widgets or more than one widget, or the signature has no certificate or external signing handler.
ArgumentOutOfRangeExceptionThrown when the page index is out of range.
Signs an existing signature field in the PDF from originalStream and writes the signed result to the configured output stream using incremental update.
When appearance is provided, the widget's visual appearance is replaced with the specified content during signing.
public void SignExistingField(Stream originalStream, string fieldName, Signature signature, FormSource appearance)
The original PDF document stream.
fieldNamestringThe name of the existing signature field to sign.
signatureSignatureThe signature containing the certificate or external signer and settings.
appearanceFormSourceThe visual appearance to apply to the signature widget, or null to preserve the existing appearance.
Thrown when originalStream, fieldName, or signature is null.
Thrown when fieldName is empty.
Thrown when signature has no certificate or external signing handler.
Signs an existing signature field in the PDF from originalStream and writes the signed result to the configured output stream using incremental update.
public void SignExistingField(Stream originalStream, string fieldName, Signature signature)
The original PDF document stream.
fieldNamestringThe name of the existing signature field to sign.
signatureSignatureThe signature containing the certificate or external signer and settings.
Exceptions: ArgumentNullExceptionThrown when originalStream, fieldName, or signature is null.
Thrown when fieldName is empty.
Thrown when signature has no certificate or external signing handler.