New to Telerik Document Processing? Start a free 30-day trial

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:

C#
public class PdfStreamSigner

Inheritance: objectPdfStreamSigner

Constructors

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

C#
public PdfStreamSigner(Stream outputStream)
Parameters:outputStreamStream

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.

C#
public void SignDocument(Stream originalStream, SignatureField signatureField, int pageIndex, TimeSpan? timeout)
Parameters:originalStreamStream

The original PDF document stream.

signatureFieldSignatureField

The signature field to be added to the document.

pageIndexint

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

timeoutTimeSpan?

The timeout for the operation.

Exceptions: ArgumentNullException

Thrown when signatureField is null or does not contain a signature.

InvalidOperationException

Thrown when the signature field contains no widgets or more than one widget, or the signature has no certificate or external signing handler.

ArgumentOutOfRangeException

Thrown 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.

C#
public void SignExistingField(Stream originalStream, string fieldName, Signature signature, FormSource appearance)
Parameters:originalStreamStream

The original PDF document stream.

fieldNamestring

The name of the existing signature field to sign.

signatureSignature

The signature containing the certificate or external signer and settings.

appearanceFormSource

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.

InvalidOperationException

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.

C#
public void SignExistingField(Stream originalStream, string fieldName, Signature signature)
Parameters:originalStreamStream

The original PDF document stream.

fieldNamestring

The name of the existing signature field to sign.

signatureSignature

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.

InvalidOperationException

Thrown when signature has no certificate or external signing handler.