PdfDocumentSigner Class
A helper class used to apply signatures to PDF documents.
Namespace: DevExpress.Pdf
Assembly: DevExpress.Docs.v24.2.dll
NuGet Package: DevExpress.Document.Processor
Declaration
Remarks
Use the PdfDocumentSigner instance to apply signatures to new or existing signature fields. Call the PdfDocumentSigner.SaveDocument method to sign and save the PDF document.
The PdfSignatureBuilder class represents signatures. The PDF Document API supports PKCS#7 signatures. You can use the Pkcs7Signer class to provide PKCS#7 signatures. Create a Pkcs7SignerBase descendant to use a custom object to create the PKCS#7 signature.
The code sample below shows how to sign an existing signature field:
using DevExpress.Pdf;
using DevExpress.Office.DigitalSignatures;
using DevExpress.Office.Tsp;
using (var signer = new PdfDocumentSigner("Document.pdf"))
{
ITsaClient tsaClient = new TsaClient(new Uri(@"http://timestamp.apple.com/ts01"), HashAlgorithmType.SHA256);
var signatureBuilder = new PdfSignatureBuilder(new Pkcs7Signer("Signing Documents//testcert.pfx", "123", HashAlgorithmType.SHA256, tsaClient),
"Sign");
signatureBuilder.SetImageData(System.IO.File.ReadAllBytes("Signing Documents//Jane Cooper.jpg"));
signatureBuilder.Location = "USA";
signer.SaveDocument("out2.pdf", signatureBuilder);
}
Implements
Inheritance
Object
PdfDocumentSigner
See Also