Click or drag to resize
Pdf Library for .NET

PdfFormFieldsCollection Class

A read-only-count collection of the AcroForm fields in a loaded document. Index by position or by field name; enumerate to walk every field.
Inheritance Hierarchy
SystemObject
  SelectPdf.UniversalPdfFormFieldsCollection

Namespace: SelectPdf.Universal
Assembly: SelectPdf.Universal (in SelectPdf.Universal.dll) Version: 26.6
Syntax
public class PdfFormFieldsCollection : IEnumerable<PdfFormField>, 
	IEnumerable

The PdfFormFieldsCollection type exposes the following members.

Properties
 NameDescription
Public propertyCount Gets the number of fields in the form. On an XFA form that lays itself out it can change as the form's scripts add or remove repeated sections.
Public propertyItemInt32Gets the field at the specified zero-based index.
Public propertyItemString Gets the field with the specified (fully-qualified) name, or null. On an XFA form that lays itself out, the name is the field's path (FullName, with or without its [0] indexes), or the field's own name, which gives the first field of that name.
Top
Methods
 NameDescription
Public methodGetEnumeratorReturns an enumerator over the fields.
Top
Example
PdfFormManager manager = new PdfFormManager();
manager.Load("form.pdf");
PdfFormFieldsCollection fields = manager.Fields;
for (int i = 0; i < fields.Count; i++)
    System.Console.WriteLine(fields[i].Name);
PdfFormField byName = fields["email"];
See Also