Getting all of the form field properties

Getting all of the form field properties

Forum member · Jul 25, 2011
When reading an existing document how can you get the properties which doesn't aren't explicitly defined in the PdfXXXFields? (Or else how do you read the FormField elements as TextField instead of PdfTextField, etc.) For example, if a field is not visible or if it is required I don't see any attribute in PDFTextField for that. Or for a Combo Box how can you tell if the user can edit the value? Or what are the values in the list of items that can be selected, as well as the default value, for a Combo or a ListBox? Although I can see how you can define these properties when creating a document with the TextField, ComboBox, ListBox, RadioButton, CheckBox, and Signature there doesn't seem to be any property in the Pdf version of the form fields.

Re: Getting all of the form field properties

Support · Jul 25, 2011
Hello, You can know whether the form field is Text field or Combo field, etc by referring to the sample example that we have on our website and also included with the download. It’s called FormFieldreader example. Below is sample code from the example: private string GetFieldType(PdfFormField pdfFormField) { if(pdfFormField is PdfTextField) { return "Text Field"; } if(pdfFormField is PdfButtonField) { return "Button Field"; } if(pdfFormField is PdfChoiceField) { return "Choice Field"; } if(pdfFormField is PdfSignatureField) { return "Signature Field"; } return "Container Field"; } For any existing form fields, you can get the name of the form field and its type. However, you cannot get additional form field details like whether the field is editable or not, export values for the choice fields like combo box to radio buttons or check boxes. Thanks, ceTe Software Support Team