我想使用 IronPdf 库生成带有签名图像的数字签名 pdf ,但我遇到了以下问题:
虽然 pdf 已进行数字签名,但签名的图像似乎并未呈现/出现在生成的 pdf 中。
上面的代码(我在控制台应用程序中测试)基于:https://ironpdf.com/docs/questions/signing/(第3种情况)
// 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 = "[email protected]";
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");
备注:
.pfx 文件是按照以下方式创建的:https://helpx.adobe.com/acrobat/using/digital-ids.html
IronPDF版本:2022.8.7894
操作系统:Windows 10 企业版
应用程序框架:.NET Core 3.1
对于
handwriting.png
文件,我也尝试过(没有成功):https://ironpdf.com/troubleshooting/digital-signatures/
我是 Iron Software 的 Vince。 这是有关签名的已知问题 - 数字签名中的图像不可见,并且已得到 IronPDF 工程师的确认。它已记录到我们的开发团队。
我已将本文链接到开发票证,因此一旦在未来的更新中解决此问题,我们将与您联系并通知您。
您可以通过 Ticket# 54677 将后续信息发送至[email protected]。
该问题已在 IronPdf 版本2023.3.2中修复。