0
我在一天中的大部分時間都研究了此問題。我有一個使用iTextSharp簽署PDF文檔的現有應用程序。數字簽名存在,文本表示顯示在PDF上的簽名字段內,但簽名的圖像不顯示。iTextSharp簽名圖像不顯示在PDF簽名字段中
以下是有問題的代碼。我很感謝您提供的任何幫助/建議。
if (signatureBitmap != null)
{
if (reader == null) reader = new PdfReader(PDFByteArray);
pdfStamper = PdfStamper.CreateSignature(reader, outputStream, PDFVersion, null, true);
PdfSignatureAppearance signatureAppearance = pdfStamper.SignatureAppearance;
//Add digital certificate to field
signatureAppearance.SetCrypto(Key, Certificate, null, PdfSignatureAppearance.SELF_SIGNED);
signatureAppearance.Reason = Reason;
signatureAppearance.Location = Location;
signatureAppearance.Render = PdfSignatureAppearance.SignatureRender.GraphicAndDescription;
if (signatureBitmap != null)
{
iTextSharp.text.Image signatureFieldImage = iTextSharp.text.Image.GetInstance(signatureBitmap, System.Drawing.Imaging.ImageFormat.Bmp);
signatureAppearance.SignatureGraphic = signatureFieldImage;
}
signatureAppearance.Acro6Layers = acroLayer;
signatureAppearance.SetVisibleSignature(acrobatSignatureFieldName);
pdfStamper.Close();
reader.Close();
reader = null;
}