Creates a choice form field, such as a list or combo box, and places it on the page.
Updates
PdfDocument's Form collection if this is a top-level form field.
Returns an instance of the PdfAnnot object
representing this form field.
Name uniquely identifies this form field.
Options is list of options for this field where the options are separated from
each other with ##,
for example "Left##Right##Center". Here, the list or combo box
will be populated by three options, "Left", "Right" and "Center".
The list may also
contain name/value pairs separated by %%. A name is what is displayed
on the page, and the value is what gets submitted when this item is selected,
for example "Left%%1##Right%%2##Center%%3". Here, the list is
still populated by the same three strings, but their underlying
values are set to 1, 2, and 3, respectively. This is
similar to the HTML block
<SELECT>
<OPTION VALUE="1">Left</OPTION>
<OPTION VALUE="2">Right</OPTION>
<OPTION VALUE="3">Center</OPTION>
</SELECT>
Selection is a string specifying the initial selection, such as
"Left". If this is a multi-select form field, the Selection
argument may be a ##-separated list of values.
Param is a PdfParam object or parameter string
specifying various appearance parameters of the checkbox field, including:
- Combo (optional) - if set to True, the
field is a combo box, otherwise it is a list box. False by default.
- Edit (optional) - if set to True, the combo
includes an editable box as well as a drop list, otherwise it
only includes a drop list. False by default.
This flag is meaningful only if Combo is set to True.
- Sort (optional) - if set to True, the items
are sorted alphabetically. The flag is intended for use by form
authoring tools, not viewer applications. False by default.
- MultiSelect (optional) - if set to True,
more than one of the field's option items may be selected
simultaneously. False by default.
- DoNoSpellCheck (optional) - if set to True,
disables spell-checking for this field. This flag
is meaningful only if both Combo and Edit
are set to True.
False by default.
- Border (optional) - the border width, 0 by
default which means no border.
- BorderColor (optional) - the border color, black by default.
- BgColor (optional) - the background color, transparent by default.
- TopIndex (optional) - for scrollable list boxes,
the top index of the first option visible in the list.
- X, Y, Width, Height, ReadOnly,
NoExport, Required, Highlight, FontSize, Print - same as in
the CreateCheckbox method described above.
Font specifies the font to be used to draw field items.
Can be set to null, "Times-Roman" by default.
Parent specifies the parent form field.
Can be set to null if this is a top-level form field.
For more information on interactive
form fields, see Chapter 11 - Form Creation.