views:

41

answers:

1

I am trying to find if it is possible to read PDF Form data (Forms filled in and saved with the form) using iTextSharp. If yes.. please provide some guidance on how.

thanks in Advance...

Bhuvan

+1  A: 

You would have to find out the field names in the PDF form. Get the fields and then read their value.

string pdfTemplate = "my.pdf";
PdfReader pdfReader = new PdfReader(pdfTemplate);
AcroFields fields = pdfReader.AcroFields.Fields;
string val = fields.GetField("fieldname");

Obviously in the code above, field name is the name of the PDF form field and the GetField method returns a string representation of that value. Here is an article with example code that you could probably use. It shows how you can both read and write form fields using iTextSharp. http://bit.ly/aAfgyB

cecilphillip
this works like a charm... I wonder why I haven't looked into this function.. when I tried every other function :). Thanks a lot.. u saved my weekend.
Bhuvan