我想使用 IronPdf 生成一个带有签名图像的数字签名 pdf库,但我遇到了以下问题:
虽然对 pdf 进行了数字签名,但签名的图像似乎并未呈现/出现在生成的 pdf 中。
以上代码(我正在控制台应用程序中测试)基于:https://ironpdf.com/docs/questions/signing/ (第三种情况)
// 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");
注意事项:
.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 将跟进发送至 developers@ironsfotware.com。
关于c# - IronPdf - 签名图像未在数字签名的 PDF 中呈现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73235481/