I would like to generate a digitally signed pdf with a signature image using the IronPdf library, but I am experiencing the following issue:
While the pdf is digitally signed, the signature's image does not seem to be rendering/appearing in the generated pdf.
The above code (that I am testing in a console app) is based on: https://ironpdf.com/docs/questions/signing/ (3rd case)
// 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("ChristosAsvestopoulos.pfx", "123abc!");
// Step 3. Optional signing options and a handwritten Signature graphic
Signature.SigningContact = "support@ironsoftware.com";
Signature.SigningLocation = "Chicago, USA";
Signature.SigningReason = "To show how to sign a PDF";
Signature.LoadSignatureImageFromFile("handwriting.png");
//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("signed.pdf");
Notes:
The .pfx file was created following this: https://helpx.adobe.com/acrobat/using/digital-ids.html
IronPdf version: 2022.8.7894
OS: Windows 10 Enterprise
application's framework: .NET Core 3.1
For handwriting.png
file I have also tried (without success) this: https://ironpdf.com/troubleshooting/digital-signatures/