ClassPdfStreamSigner
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:
public class PdfStreamSigner
Inheritance: objectPdfStreamSigner
Constructors
PdfStreamSigner(Stream)
Creates a signer that writes the signed PDF to the specified outputStream.
Declaration
public PdfStreamSigner(Stream outputStream)
Parameters
outputStream
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
public void SignDocument(Stream originalStream, SignatureField signatureField, int pageIndex, TimeSpan? timeout)
Parameters
originalStream
The original PDF document stream.
signatureField
The signature field to be added to the document.
pageIndex
The index of the page where the signature will be added.
timeout
The timeout for the operation.
Exceptions
Thrown when the signature field contains no widgets or more than one widget, as it must contain exactly one widget for proper signing.
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
public void SignExistingField(Stream originalStream, string fieldName, Signature signature)
Parameters
originalStream
The original PDF document stream.
fieldName
The name of the existing signature field to sign.
signature
The signature containing the certificate or external signer and settings.
Exceptions
Thrown when originalStream, fieldName, or signature is null.
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
public void SignExistingField(Stream originalStream, string fieldName, Signature signature, FormSource appearance)
Parameters
originalStream
The original PDF document stream.
fieldName
The name of the existing signature field to sign.
signature
The signature containing the certificate or external signer and settings.
appearance
The visual appearance to apply to the signature widget, or null to preserve the existing appearance.
Exceptions
Thrown when originalStream, fieldName, or signature is null.
Thrown when fieldName is empty.