Sign Using Existing Signature Field with Azure KV

How do I sign using an "existing signature field" when using this example ( Create a PDF Digital Signature Web Service Using Azure Key Vault and the Syncfusion C# PDF Library)?

Replace PdfSignature signature = new PdfSignature(loadedDocument, page!, null, "Sig1");  


Code2.jpg



1 Reply

IJ Irfana Jaffer Sadhik Syncfusion Team January 10, 2025 01:03 PM UTC

Hi slynch,

We can sign a PDF document using an existing unsigned signature field. Refer to the following code snippet to sign the document with the existing signature field:

 

 

// Load the PDF document.

PdfLoadedDocument loadedDocument = new PdfLoadedDocument(pdfFile);

 

// Load the existing page.

PdfLoadedPage? page = loadedDocument.Pages[0] as PdfLoadedPage;

 

// Get the existing unsigned signature field.

PdfLoadedSignatureField lSigField = loadedDocument.Form.Fields[0] as PdfLoadedSignatureField;

 

// Create a new PDF signature object with the loaded signature field.

PdfSignature signature = new PdfSignature(loadedDocument, page!, null, "Sig1", lSigField);

 

Try the above code and let us know if you need further assistance. For additional details, you can refer to our UG documentation.


Regards,

Irfana J.



Loader.
Up arrow icon