Turgay Gençer
Turgay Gençer

Reputation: 121

Changing Date Format on PDF Signature Stamp

I can sign a pdf file, but the time format is too long. I wabt to change Date format, but I couldnt..

Here is my code.

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);**

And, at the my pdf file, the signature stamp is like this: "2012.11.01 05:21:00 +02:00"

but I want to like that: "01.11.2012 19:21:00"

Upvotes: 0

Views: 3397

Answers (1)

Bruno Lowagie
Bruno Lowagie

Reputation: 77606

Please go to http://itextpdf.com/book/digitalsignatures and read section 2.4 to find out how to create different signature appearances.

Upvotes: 2

Related Questions