IronPdf - 签名未显示在签名面板中

问题描述 投票:0回答:1

我正在尝试使用他们的示例在 IronPDF 中创建一个示例 PDF,并稍作修改

// 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");

文件已创建,我可以打开该文件。我还可以看到以下输出。我被明确告知有签名并且有效。然而,列表中没有出现实际签名。

这是我创建 PDF 时出现的错误吗?这和 Adobe 之间有脱节吗?还是别的什么?

c# pdf digital-signature ironpdf
1个回答
0
投票

这是一个已知的错误。该问题已在 IronPdf 版本2023.6.10中解决。

SignPdfWithDigitalSignature
方法已被弃用,请使用
Sign
方法。检查以下代码示例以供参考:

// 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");

要了解有关 IronPdf 数字签名的更多信息,请访问 对 PDF 文档进行数字签名

© www.soinside.com 2019 - 2024. All rights reserved.