How do I get a field name from a PDF file?
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.
How do I iterate over all fields and get their names?
Greg, you can iterate over all fields and get their names. Look at the Doc.getNthFieldName () function and the Doc.numFields property to do that. I would like to export a spreadsheet form in excel into an FILLABLE PDF form. When I use excel’s ‘Save As pdf’ the pdf file that is created is not fillable.
How do I add interactive fields to a PDF file?
To get these elements into a PDF file, you have two options: Create your own PDF export routine that does have the ability to recognize and export these interactive fields, or let Acrobat or Excel create the PDF file for you, and you then – in a second step – add these interactive fields to the newly created PDF file.