pdftools_toolbox.pdf.forms.combo_box
Classes
|
A combo box field |
- class pdftools_toolbox.pdf.forms.combo_box.ComboBox(handle)[source]
Bases:
ChoiceField
A combo box field
- static create(target_document: Document) ComboBox [source]
Create a combo box form field
The returned form field object is not yet used, but it is associated with the given target document.
- Parameters:
targetDocument (pdftools_toolbox.pdf.document.Document) – the output document with which the returned object is associated
- Returns:
the newly created combo box field
- Return type:
- Raises:
ValueError – if the targetDocument argument has already been closed
ValueError – if the targetDocument argument is read-only
ValueError – the target document contains form fields that have been implicitly copied by a call to
pdftools_toolbox.pdf.page.Page.copy()
with an argument options from pdftools_toolbox.pdf.page.Page.copy in whichpdftools_toolbox.pdf.page_copy_options.PageCopyOptions.form_fields
was set topdftools_toolbox.pdf.forms.form_field_copy_strategy.FormFieldCopyStrategy.COPY
ValueError – the target document contains unsigned signatures that have been implicitly copied by a call to
pdftools_toolbox.pdf.page.Page.copy()
with an argument options from pdftools_toolbox.pdf.page.Page.copy in whichpdftools_toolbox.pdf.page_copy_options.PageCopyOptions.unsigned_signatures
was set topdftools_toolbox.pdf.copy_strategy.CopyStrategy.COPY
.
- property can_edit: bool
Has an editable item
- Returns:
bool
- Raises:
StateError – if the object has already been closed
- property chosen_item: ChoiceItem | None
The selected combo box item
If this property is None then the
pdftools_toolbox.pdf.forms.combo_box.ComboBox.editable_item_name
is the selected value. Setting this property automatically setspdftools_toolbox.pdf.forms.combo_box.ComboBox.editable_item_name
to None.- Returns:
Optional[pdftools_toolbox.pdf.forms.choice_item.ChoiceItem]
- Raises:
StateError – if the object has already been closed
- property editable_item_name: str | None
The name of the editable item
This property is None if any of the combo box items is selected, i.e., if
pdftools_toolbox.pdf.forms.combo_box.ComboBox.chosen_item
is not None. Setting this property automatically setspdftools_toolbox.pdf.forms.combo_box.ComboBox.chosen_item
to None.- Returns:
Optional[str]
- Raises:
StateError – if the object has already been closed
- property font_size: float
The font size
If 0.0 is set, then the font size is chosen automatically by the PDF processor.
- Returns:
float
- Raises:
StateError – if the object has already been closed