Digital Signature Date time Format

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v7)  /  Digital Signature Date time Format

DynamicPDF CoreSuite for .NET (v7) Forum

 Apr 04 2013 5:23 AM
Hi,
C
Currently,I used Dynamic pdf generate for pdf generation with Digital Signature but we want to change the date format of digital signature like "April 4,2013 3:03:16 PM IST" instead of "2013/04/03 13:12:25 +05'30'" .is this possible ?

 Please,Reply as soon possible.


Thanks & Regard,
Niraj Pandey
Posted by a ceTe Software moderator
Hello Niraj,

Yes, you can achieve your requirement without any problem using our DynamicPDF for .NET product. You will need to hide the right panel text of the signature and reset the desired string to it using CustomMessage property. Below is the sample code for it.

           Document document = new Document();
           Page page = new Page();
           Signature signature = new Signature("SigField", 10, 10, 250, 100);
            page.Elements.Add(signature);
            document.Pages.Add(page);

            Certificate certificate = new Certificate(@"C:Data/JohnDoe.pfx", "dynamicpdf");
            StringBuilder outputString = new StringBuilder();
            outputString.Append("Digitally signed by ");
            outputString.Append(certificate.SubjectName);
            outputString.Append("DN: ");
            outputString.Append(certificate.Subject);
            outputString.Append("Date: ");

            DateTime dt = DateTime.Now;
            DateTime udt = dt.ToUniversalTime();

            string dateStringFormat = DateTime.Now.ToString("MMMM dd,yyyy HH:mm:ss tt 'IST' ");
            outputString.Append(dateStringFormat);
            outputString.Append("Message added Manually");

            signature.RightPanel.HideAllText();
            signature.RightPanel.CustomMessage = outputString.ToString();
            document.Sign("SigField", certificate);
            document.Draw(@"C:\MyDocument.pdf");

Thanks,
ceTe Software Support Team.
How do you sign in a signature date format
Posted by a ceTe Software moderator
Hello,

If you are trying to specify a date format to the signature, please refer to the sample code (above) in our last post. If not, please provide more information on your requirement so we can point you in the right direction.

Thanks,
ceTe Software Support Team.

All times are US Eastern Standard time. The time now is 12:19 AM.