更改PDF签名戳的日期格式

时间:2012-11-01 17:09:54

标签: pdf itextsharp itext digital-signature date-format

我可以签署pdf文件,但时间格式太长。 我想改变日期格式,但我不能......

这是我的代码。

PdfReader reader = new PdfReader(input);
PdfStamper stp = PdfStamper.CreateSignature(reader, output, '\0');
PdfSignatureAppearance sap = stp.SignatureAppearance;
**sap.SignDate = DateTime.Now;**
sap.SetCrypto(null, chain, null, PdfSignatureAppearance.WINCER_SIGNED);
sap.Reason = "Testování";
sap.Location = "Praha";
sap.Acro6Layers = true;
sap.Render = PdfSignatureAppearance.SignatureRender.GraphicAndDescription;
PdfSignature dic = new PdfSignature(PdfName.ADOBE_PPKMS, PdfName.ADBE_PKCS7_SHA1);
**dic.Date = new PdfDate(sap.SignDate);**

而且,在我的pdf文件中,签名图章是这样的: “2012.11.01 05:21:00 +02:00”

但我想这样:“01.11.2012 19:21:00”

1 个答案:

答案 0 :(得分:2)

请转到http://itextpdf.com/book/digitalsignatures并阅读第2.4节,了解如何创建不同的签名外观。

相关问题