IronPdf - Signature not displaying in Signature Panel

155 Views Asked by At

I'm attempting to create a sample PDF in IronPDF using their example, with a slight modification

// Step 1. Create a PDF
ChromePdfRenderer Renderer = new ChromePdfRenderer();
using PdfDocument doc = Renderer.RenderHtmlAsPdf("<h1>Testing 2048 bit digital security</h1>");

// Step 2. Create a Signature.
// You may create a .pfx or .p12 PDF signing certificate using Adobe Acrobat Reader.
// Read: https://helpx.adobe.com/acrobat/using/digital-ids.html
var Signature = new IronPdf.Signing.PdfSignature("My_Signature.pfx", "123abc!");

// Step 3. Optional signing options and a handwritten Signature graphic
Signature.SigningContact = "[email protected]";
Signature.SigningLocation = "Chicago, USA";
Signature.SigningReason = "To show how to sign a PDF";

//Step 4. Sign the PDF with the PdfSignature. Multiple signing certificates may be used
doc.SignPdfWithDigitalSignature(Signature);

//Step 5. The PDF is not signed until saved to file, steam or byte array.
doc.SaveAs("sample.pdf");

The file creates and I can open the file. I can additionally see the following output. I am clearly told that there is a signature and it's valid. However, there's no actual signature showing up in the list.

Is this an error in how I'm creating the PDF? A disconnect between this and Adobe? Or something else?

Signature panel

1

There are 1 best solutions below

0
Chaknith Bin On

This is a known bug. It has already been solved in IronPdf version 2023.6.10. The SignPdfWithDigitalSignature method has been deprecated, please use the Sign method. Check the following code example for reference:

// Step 1. Create a PDF
ChromePdfRenderer Renderer = new ChromePdfRenderer();
PdfDocument doc = Renderer.RenderHtmlAsPdf("<h1>Testing 2048 bit digital security</h1>");

// Step 2. Create a Signature.
// You may create a .pfx or .p12 PDF signing certificate using Adobe Acrobat Reader.
// Read: https://helpx.adobe.com/acrobat/using/digital-ids.html
var Signature = new IronPdf.Signing.PdfSignature("My_Signature.pfx", "123abc!");

// Step 3. Optional signing options and a handwritten Signature graphic
Signature.SigningContact = "[email protected]";
Signature.SigningLocation = "Chicago, USA";
Signature.SigningReason = "To show how to sign a PDF";

//Step 4. Sign the PDF with the PdfSignature. Multiple signing certificates may be used
doc.Sign(Signature);

//Step 5. The PDF is not signed until saved to file, steam or byte array.
doc.SaveAs("sample.pdf");

To learn more about digital signing with IronPdf please visit Digitally Sign a PDF Document