Using iText Sharp to read a PDF Form and get the Signature Information

I need to get Certificate Info from a PDF Form.  Not sure how to do this with iTextSharp.

Here is some sample code:

        public ActionResult Upload(HttpPostedFileBase file, string Name)

            if (file != null && file.ContentLength > 0)
                    string pdfTemplate = "NewRequest.pdf";
                    byte[] pdfbytes = null;

                    BinaryReader rdr = new BinaryReader(file.InputStream);
                    pdfbytes = rdr.ReadBytes((int)file.ContentLength);
                    PdfReader reader = new PdfReader(pdfbytes);
                    //PdfReader _reader = new PdfReader((byte[])file).ToArray();

                    string t = Name.Trim().Length == 0 ? null : Name;
                    var fields = reader.AcroFields.Fields;
                    var RequestID = reader.AcroFields.GetField("requestId");
                    CultureInfo MyCultureInfo = new CultureInfo("en-US");
                    var OpenDate = reader.AcroFields.GetField("openDate");
                    DateTime? OpenDate2 = null;
                        OpenDate2 = DateTime.ParseExact(OpenDate, "d/M/yyyy h:mm", MyCultureInfo);
                        OpenDate2 = null;
                    var Org = reader.AcroFields.GetField("organization");
                    DateTime? NeedDate = Convert.ToDateTime(reader.AcroFields.GetField("needDate"));
                    var FirstName = reader.AcroFields.GetField("firstName");
                    var LastName = reader.AcroFields.GetField("lastName");
                    var Email = reader.AcroFields.GetField("email");
                    var Phone = reader.AcroFields.GetField("phone");
                    DateTime StartDate = Convert.ToDateTime(reader.AcroFields.GetField("startDate"));
                    DateTime EndDate = Convert.ToDateTime(reader.AcroFields.GetField("endDate"));
                    var Notes = reader.AcroFields.GetField("notes");
                    //var signature = reader.AcroFields.GetField("Signature");

Open in new window

I need to set a variable for signature to the Signature field in my form.  It is coming thru as blank.
Crystal RouseTask LeadAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Crystal RouseTask LeadAuthor Commented:
I figured this out myself:

 var sig = reader.AcroFields.VerifySignature("Signature").SignName;
DateTime? sigDate = Convert.ToDateTime(reader.AcroFields.VerifySignature("Signature").SignDate);

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.