Class
PdfStreamSigner

Applies a digital signature to an existing PDF using incremental update, avoiding a full file rewrite.

Definition

Namespace:Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Streaming

Assembly:Telerik.Windows.Documents.Fixed.dll

Syntax:

cs-api-definition
public class PdfStreamSigner

Inheritance: objectPdfStreamSigner

Constructors

PdfStreamSigner(Stream)

Creates a signer that writes the signed PDF to the specified outputStream.

Declaration

cs-api-definition
public PdfStreamSigner(Stream outputStream)

Parameters

outputStream

Stream

The output stream where the signed document will be written.

Methods

SignDocument(Stream, SignatureField, int, TimeSpan?)

Signs the PDF from originalStream, places signatureField on pageIndex, and writes the signed result to the configured output stream.

Declaration

cs-api-definition
public void SignDocument(Stream originalStream, SignatureField signatureField, int pageIndex, TimeSpan? timeout)

Parameters

originalStream

Stream

The original PDF document stream.

signatureField

SignatureField

The signature field to be added to the document.

pageIndex

int

The index of the page where the signature will be added.

timeout

TimeSpan?

The timeout for the operation.

Exceptions

InvalidOperationException

Thrown when the signature field contains no widgets or more than one widget, as it must contain exactly one widget for proper signing.

ArgumentOutOfRangeException

Thrown when the page index is out of range.

SignExistingField(Stream, string, Signature)

Signs an existing signature field in the PDF from originalStream and writes the signed result to the configured output stream using incremental update.

Declaration

cs-api-definition
public void SignExistingField(Stream originalStream, string fieldName, Signature signature)

Parameters

originalStream

Stream

The original PDF document stream.

fieldName

string

The name of the existing signature field to sign.

signature

Signature

The signature containing the certificate or external signer and settings.

Exceptions

ArgumentNullException

Thrown when originalStream, fieldName, or signature is null.

ArgumentException

Thrown when fieldName is empty.

SignExistingField(Stream, string, Signature, FormSource)

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.

Declaration

cs-api-definition
public void SignExistingField(Stream originalStream, string fieldName, Signature signature, FormSource appearance)

Parameters

originalStream

Stream

The original PDF document stream.

fieldName

string

The name of the existing signature field to sign.

signature

Signature

The signature containing the certificate or external signer and settings.

appearance

FormSource

The visual appearance to apply to the signature widget, or null to preserve the existing appearance.

Exceptions

ArgumentNullException

Thrown when originalStream, fieldName, or signature is null.

ArgumentException

Thrown when fieldName is empty.