我正在使用iTextSharp对PDF进行签名。签名时,它会在文档上标记4个字段:签名人、时间、原因和位置。我想做的是在下面(或上面,无关紧要)添加一个带有自定义信息的字段。
有什么想法吗?
下面是生成图章的代码:
PdfStamper stp = PdfStamper.CreateSignature(reader, memoryOut, '\0');
PdfSignatureAppearance sap = stp.SignatureAppearance;
iTextSharp.text.Rectangle rectangle = new iTextSharp.text.Rectangle(100, 100, 500, 200);
sap.SetVisibleSignature(rectangle, stp.Reader.NumberOfPages, null);
sap.SignDate = DateTime.Now;
sap.SetCrypto(null, chain, null, null);
sap.Reason = ssReason;
sap.Contact = ssContact;
sap.Location = ssLocation;
sap.Acro6Layers = true;
//sap.SignatureGraphic = iTextSharp.text.Image.GetInstance(ssImageUrl);
//sap.SignatureGraphic.ScaleToFit(131, 45);
sap.Render = PdfSignatureAppearance.SignatureRender.Description;发布于 2011-02-10 05:40:58
有几个选项:
从sap.getLayer(int).修改其中一个PdfTemplate的
sap.setLayer2Text()以包含您的额外信息。PdfTemplate包装在Image中,这样就可以绘制任何您想要的东西。然后sap.Render = PdfSignatureAppearance.SignatureRender.GraphicAndDescription
https://stackoverflow.com/questions/4924330
复制相似问题