如何使用 itextsharp C# 从签名字段中删除有效性未知图标?
How to remove validity unknown icon from signature field using itextsharp C#?
如何在计算 pdf 的哈希值之前从签名字段中删除有效性未知图标(问号)。
下面是我用来创建签名字段的代码。
PdfStamper stamper = PdfStamper.CreateSignature(reader, os, '[=10=]');
PdfSignatureAppearance appearance = stamper.SignatureAppearance;
appearance.SignDate = DateTime.Now.AddMinutes(15);
appearance.Reason = reasonForSign;
appearance.Contact = "";
appearance.Location = locationToShowOnSignatureStamp;
appearance.Acro6Layers = false;
appearance.Image = null;
appearance.SignatureRenderingMode = PdfSignatureAppearance.RenderingMode.DESCRIPTION;
appearance.CertificationLevel = PdfSignatureAppearance.NOT_CERTIFIED;
appearance.SetVisibleSignature(new iTextSharp.text.Rectangle(10, 10, 149, 69), reader.NumberOfPages, "s1");
您的代码明确请求该图标:您使用
appearance.Acro6Layers = false;
这指示 itext 创建签名外观,就像 Adobe Acrobat 最高版本 5 所做的那样。这包括 "layers" 用于验证结果为肯定、不确定或否定的签名。如果你使用
appearance.Acro6Layers = true;
相反(这是默认设置),itext 创建签名,Adobe Acrobat 将不再为其显示验证结果的此类页面可视化效果。
如何在计算 pdf 的哈希值之前从签名字段中删除有效性未知图标(问号)。
下面是我用来创建签名字段的代码。
PdfStamper stamper = PdfStamper.CreateSignature(reader, os, '[=10=]');
PdfSignatureAppearance appearance = stamper.SignatureAppearance;
appearance.SignDate = DateTime.Now.AddMinutes(15);
appearance.Reason = reasonForSign;
appearance.Contact = "";
appearance.Location = locationToShowOnSignatureStamp;
appearance.Acro6Layers = false;
appearance.Image = null;
appearance.SignatureRenderingMode = PdfSignatureAppearance.RenderingMode.DESCRIPTION;
appearance.CertificationLevel = PdfSignatureAppearance.NOT_CERTIFIED;
appearance.SetVisibleSignature(new iTextSharp.text.Rectangle(10, 10, 149, 69), reader.NumberOfPages, "s1");
您的代码明确请求该图标:您使用
appearance.Acro6Layers = false;
这指示 itext 创建签名外观,就像 Adobe Acrobat 最高版本 5 所做的那样。这包括 "layers" 用于验证结果为肯定、不确定或否定的签名。如果你使用
appearance.Acro6Layers = true;
相反(这是默认设置),itext 创建签名,Adobe Acrobat 将不再为其显示验证结果的此类页面可视化效果。