PdfFieldCollection Class
Represents a collection of all fields in an interactive form.
[ComVisible(false)]
public sealed class PdfFieldCollection : PdfCollection<PdfField>, IList, ICollection, IList<PdfField>, ICollection<PdfField>, IEnumerable<PdfField>, IEnumerable
<ComVisible(False)>
Inherits PdfCollection(Of PdfField)
Implements IList, ICollection, IList(Of PdfField), ICollection(Of PdfField), IEnumerable(Of PdfField), IEnumerable
- Inheritance:
- System.ObjectPdfFieldCollection
Implements
Properties
Item[String]
Gets the first occurrence of a PdfField with the specified (fully qualified) field name or null.
public PdfField this[string fieldName] { get; }
Public ReadOnly Property Item(fieldName As String) As PdfField
Parameters
fieldName
- System.String
The (fully qualified) name of the field.
Property Value
NewRadioButtonName
Gets the name that will be applied to the newly created PdfRadioButtonField.
Property Value
- System.String
The name that will be applied to the newly created PdfRadioButtonField.
Methods
AddButton(PdfPage, Double, Double, Double, Double)
Adds a new PdfButtonField to the PdfFieldCollection.
Its associated widget annotation will be added to the page
and annotation's rectangle will be defined by left
, bottom
, width
and height
in default user space units.
Its Name will be automatically set.
public PdfButtonField AddButton(PdfPage page, double left, double bottom, double width, double height)
Public Function AddButton(page As PdfPage, left As Double, bottom As Double, width As Double, height As Double) As PdfButtonField
Parameters
page
- PdfPage
The page on which the PdfButtonField's associated widget annotation will be added.
left
- System.Double
The lower-left horizontal coordinate of the PdfButtonField's associated widget annotation rectangle on page
specified in default user space units.
bottom
- System.Double
The lower-left vertical coordinate of the PdfButtonField's associated widget annotation rectangle on page
specified in default user space units.
width
- System.Double
The width of the PdfButtonField's associated widget annotation rectangle specified in default user space units.
height
- System.Double
The height of the PdfButtonField's associated widget annotation rectangle specified in default user space units.
Returns
A new PdfButtonField added to the PdfFieldCollection.
AddCheckBox(PdfPage, Double, Double, Double, Double)
Adds a new PdfCheckBoxField to the PdfFieldCollection.
Its associated widget annotation will be added to the page
and annotation's rectangle will be defined by left
, bottom
, width
and height
in default user space units.
Its Name will be automatically set.
public PdfCheckBoxField AddCheckBox(PdfPage page, double left, double bottom, double width, double height)
Public Function AddCheckBox(page As PdfPage, left As Double, bottom As Double, width As Double, height As Double) As PdfCheckBoxField
Parameters
page
- PdfPage
The page on which the PdfCheckBoxField's associated widget annotation will be added.
left
- System.Double
The lower-left horizontal coordinate of the PdfCheckBoxField's associated widget annotation rectangle on page
specified in default user space units.
bottom
- System.Double
The lower-left vertical coordinate of the PdfCheckBoxField's associated widget annotation rectangle on page
specified in default user space units.
width
- System.Double
The width of the PdfCheckBoxField's associated widget annotation rectangle specified in default user space units.
height
- System.Double
The height of the PdfCheckBoxField's associated widget annotation rectangle specified in default user space units.
Returns
A new PdfCheckBoxField added to the PdfFieldCollection.
AddDropdown(PdfPage, Double, Double, Double, Double)
Adds a new PdfDropdownField to the PdfFieldCollection.
Its associated widget annotation will be added to the page
and annotation's rectangle will be defined by left
, bottom
, width
and height
in default user space units.
Its Name will be automatically set.
public PdfDropdownField AddDropdown(PdfPage page, double left, double bottom, double width, double height)
Public Function AddDropdown(page As PdfPage, left As Double, bottom As Double, width As Double, height As Double) As PdfDropdownField
Parameters
page
- PdfPage
The page on which the PdfDropdownField's associated widget annotation will be added.
left
- System.Double
The lower-left horizontal coordinate of the PdfDropdownField's associated widget annotation rectangle on page
specified in default user space units.
bottom
- System.Double
The lower-left vertical coordinate of the PdfDropdownField's associated widget annotation rectangle on page
specified in default user space units.
width
- System.Double
The width of the PdfDropdownField's associated widget annotation rectangle specified in default user space units.
height
- System.Double
The height of the PdfDropdownField's associated widget annotation rectangle specified in default user space units.
Returns
A new PdfDropdownField added to the PdfFieldCollection.
AddImage(PdfPage, Double, Double, Double, Double)
Adds a new PdfButtonField to the PdfFieldCollection.
Its associated widget annotation will be added to the page
and annotation's rectangle will be defined by left
, bottom
, width
and height
in default user space units.
Its Name will be automatically set.
public PdfButtonField AddImage(PdfPage page, double left, double bottom, double width, double height)
Public Function AddImage(page As PdfPage, left As Double, bottom As Double, width As Double, height As Double) As PdfButtonField
Parameters
page
- PdfPage
The page on which the Image field's associated widget annotation will be added.
left
- System.Double
The lower-left horizontal coordinate of the Image field's associated widget annotation rectangle on page
specified in default user space units.
bottom
- System.Double
The lower-left vertical coordinate of the Image field's associated widget annotation rectangle on page
specified in default user space units.
width
- System.Double
The width of the Image field's associated widget annotation rectangle specified in default user space units.
height
- System.Double
The height of the Image field's associated widget annotation rectangle specified in default user space units.
Returns
A new PdfButtonField added to the PdfFieldCollection.
Remarks
Image field is just a customized PdfButtonField.
The most notable customizations are that its Name ends with an "_af_image" suffix, its Actions contains an instance of an PdfRunJavaScriptAction that imports an icon to the button, and its LabelPlacement is set to IconOnly.
To set a PdfImage to the Image field, use the SetIcon(PdfImage, PdfAppearanceTrigger) method on the Image field's Appearance.
AddListBox(PdfPage, Double, Double, Double, Double)
Adds a new PdfListBoxField to the PdfFieldCollection.
Its associated widget annotation will be added to the page
and annotation's rectangle will be defined by left
, bottom
, width
and height
in default user space units.
Its Name will be automatically set.
public PdfListBoxField AddListBox(PdfPage page, double left, double bottom, double width, double height)
Public Function AddListBox(page As PdfPage, left As Double, bottom As Double, width As Double, height As Double) As PdfListBoxField
Parameters
page
- PdfPage
The page on which the PdfListBoxField's associated widget annotation will be added.
left
- System.Double
The lower-left horizontal coordinate of the PdfListBoxField's associated widget annotation rectangle on page
specified in default user space units.
bottom
- System.Double
The lower-left vertical coordinate of the PdfListBoxField's associated widget annotation rectangle on page
specified in default user space units.
width
- System.Double
The width of the PdfListBoxField's associated widget annotation rectangle specified in default user space units.
height
- System.Double
The height of the PdfListBoxField's associated widget annotation rectangle specified in default user space units.
Returns
A new PdfListBoxField added to the PdfFieldCollection.
AddRadioButton(PdfPage, Double, Double, Double, Double)
Adds a new PdfRadioButtonField to the PdfFieldCollection.
Its associated widget annotation will be added to the page
and annotation's rectangle will be defined by left
, bottom
, width
and height
in default user space units.
Its Name will be automatically set to the value of NewRadioButtonName.
public PdfRadioButtonField AddRadioButton(PdfPage page, double left, double bottom, double width, double height)
Public Function AddRadioButton(page As PdfPage, left As Double, bottom As Double, width As Double, height As Double) As PdfRadioButtonField
Parameters
page
- PdfPage
The page on which the PdfRadioButtonField's associated widget annotation will be added.
left
- System.Double
The lower-left horizontal coordinate of the PdfRadioButtonField's associated widget annotation rectangle on page
specified in default user space units.
bottom
- System.Double
The lower-left vertical coordinate of the PdfRadioButtonField's associated widget annotation rectangle on page
specified in default user space units.
width
- System.Double
The width of the PdfRadioButtonField's associated widget annotation rectangle specified in default user space units.
height
- System.Double
The height of the PdfRadioButtonField's associated widget annotation rectangle specified in default user space units.
Returns
A new PdfRadioButtonField added to the PdfFieldCollection.
AddSignature()
Adds a new invisible PdfSignatureField to the PdfFieldCollection.
Its associated widget annotation will be added to the first page of the Pages and annotation's rectangle will have zero height and width, thus making the signature invisible.
Its Name will be automatically set.
Returns
A new invisible PdfSignatureField added to the PdfFieldCollection.
AddSignature(PdfPage, Double, Double, Double, Double)
Adds a new visible PdfSignatureField to the PdfFieldCollection.
Its associated widget annotation will be added to the page
and annotation's rectangle will be defined by left
, bottom
, width
and height
in default user space units.
Its Name will be automatically set.
public PdfSignatureField AddSignature(PdfPage page, double left, double bottom, double width, double height)
Public Function AddSignature(page As PdfPage, left As Double, bottom As Double, width As Double, height As Double) As PdfSignatureField
Parameters
page
- PdfPage
The page on which the PdfSignatureField's associated widget annotation will be added.
left
- System.Double
The lower-left horizontal coordinate of the PdfSignatureField's associated widget annotation rectangle on page
specified in default user space units.
bottom
- System.Double
The lower-left vertical coordinate of the PdfSignatureField's associated widget annotation rectangle on page
specified in default user space units.
width
- System.Double
The width of the PdfSignatureField's associated widget annotation rectangle specified in default user space units.
height
- System.Double
The height of the PdfSignatureField's associated widget annotation rectangle specified in default user space units.
Returns
A new visible PdfSignatureField added to the PdfFieldCollection.
AddText(PdfPage, Double, Double, Double, Double)
Adds a new PdfTextField to the PdfFieldCollection.
Its associated widget annotation will be added to the page
and annotation's rectangle will be defined by left
, bottom
, width
and height
in default user space units.
Its Name will be automatically set.
public PdfTextField AddText(PdfPage page, double left, double bottom, double width, double height)
Public Function AddText(page As PdfPage, left As Double, bottom As Double, width As Double, height As Double) As PdfTextField
Parameters
page
- PdfPage
The page on which the PdfTextField's associated widget annotation will be added.
left
- System.Double
The lower-left horizontal coordinate of the PdfTextField's associated widget annotation rectangle on page
specified in default user space units.
bottom
- System.Double
The lower-left vertical coordinate of the PdfTextField's associated widget annotation rectangle on page
specified in default user space units.
width
- System.Double
The width of the PdfTextField's associated widget annotation rectangle specified in default user space units.
height
- System.Double
The height of the PdfTextField's associated widget annotation rectangle specified in default user space units.
Returns
A new PdfTextField added to the PdfFieldCollection.
GetEnumerator()
Returns an enumerator that iterates through the PdfFieldCollection.
public PdfFieldCollection.Enumerator GetEnumerator()
Public Function GetEnumerator As PdfFieldCollection.Enumerator
Returns
Refresh()
Forces an update of the PdfFieldCollection to include all PdfFields contained in the Annotations of all Pages that are not already contained in the PdfFieldCollection.
This method also handles the invalid AcroForm entry in the Catalog dictionary, updates the Page property of all PdfAnnotations in the PdfDocument, and removes the invalid Parent entry of all Field dictionaries in the PdfDocument.
Inherited Properties
Count | Gets the number of elements contained in the PdfCollection. (Inherited from PdfCollection) |
Metadata | (Optional; PDF 1.4) A metadata stream containing metadata for the component. (Inherited from PdfObject) |
Inherited Methods
Clear() | Removes all elements from the PdfCollection. (Inherited from PdfCollection) |
RemoveAt(System.Int32) | Removes the element at the specified index of the PdfCollection. (Inherited from PdfCollection) |