PdfComboBoxField
Represents a combo box (drop-down list) form field in a PDF document. Combo boxes display a list of options and may optionally allow custom text entry.
from nutrient import PdfComboBoxFieldMethods
add_item
def add_item(self, text: str) -> NoneAdds an item to the combo box.
Parameters:
| Name | Type | Description |
|---|---|---|
text | str | The display text for the item. |
Raises:
SdkException: Thrown when the operation fails.
add_item
def add_item(self, text: str, value: str) -> NoneAdds an item to the combo box with a separate export value.
Parameters:
| Name | Type | Description |
|---|---|---|
text | str | The display text for the item. |
value | str | The export value for the item. |
Raises:
SdkException: Thrown when the operation fails.
get_child
def get_child(self, index: int) -> PdfFormFieldParameters:
| Name | Type | Description |
|---|---|---|
index | int |
Returns: PdfFormField
get_widget
def get_widget(self, index: int) -> PdfWidgetAnnotationParameters:
| Name | Type | Description |
|---|---|---|
index | int |
Returns: PdfWidgetAnnotation
remove_child_at
def remove_child_at(self, index: int) -> NoneParameters:
| Name | Type | Description |
|---|---|---|
index | int |
remove_item_at
def remove_item_at(self, index: int) -> NoneRemoves an item from the combo box at the specified index.
Parameters:
| Name | Type | Description |
|---|---|---|
index | int | The 0-based index of the item to remove. |
Raises:
IndexOutOfBoundsException: Thrown when index is out of range.SdkException: Thrown when the operation fails.
set_is_read_only
def set_is_read_only(self, value: bool) -> NoneParameters:
| Name | Type | Description |
|---|---|---|
value | bool |
set_is_required
def set_is_required(self, value: bool) -> NoneParameters:
| Name | Type | Description |
|---|---|---|
value | bool |
set_selected_value
def set_selected_value(self, value: str) -> NoneSets the currently selected or entered value.
Parameters:
| Name | Type | Description |
|---|---|---|
value | str | The value to set for the SelectedValue property. |
set_value
def set_value(self, value: str) -> NoneParameters:
| Name | Type | Description |
|---|---|---|
value | str |
Properties
child_count
@propertydef child_count(self) -> intType: int
Read-only property.
default_value
@propertydef default_value(self) -> strType: str
Read-only property.
field_type
@propertydef field_type(self) -> PdfFormFieldTypeType: PdfFormFieldType
Read-only property.
full_name
@propertydef full_name(self) -> strType: str
Read-only property.
has_selection
@propertydef has_selection(self) -> boolGets whether the combo box has a value selected or entered.
Type: bool
Read-only property.
is_read_only
@propertydef is_read_only(self) -> boolType: bool
Read-only property.
is_required
@propertydef is_required(self) -> boolType: bool
Read-only property.
is_terminal
@propertydef is_terminal(self) -> boolType: bool
Read-only property.
item_count
@propertydef item_count(self) -> intGets the number of items in the combo box.
Type: int
Read-only property.
name
@propertydef name(self) -> strType: str
Read-only property.
parent
@propertydef parent(self) -> PdfFormFieldType: PdfFormField
Read-only property.
selected_value
@propertydef selected_value(self) -> strGets the currently selected or entered value.
Type: str
Read-only property.
value
@propertydef value(self) -> strType: str
Read-only property.
widget_count
@propertydef widget_count(self) -> intType: int
Read-only property.