pdftools_toolbox.pdf.forms.list_box
Classes
|
A list box field |
- class pdftools_toolbox.pdf.forms.list_box.ListBox(handle)[source]
Bases:
ChoiceField
A list box field
- static create(target_document: Document) ListBox [source]
Create a list 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 list 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 allow_multi_select: bool
Allow multiple items to be selected
- Returns:
bool
- Raises:
StateError – if the object has already been closed
- property chosen_items: ChoiceItemList
The selected choice items
Adding to this list results in an error:
IllegalState - if the list has already been closed - if the choice field is marked a read-only - if this list is not empty and the list box field is not marked as multi-select - if the choice field has widgets
UnsupportedOperation if the document is read-only
IllegalArgument - if the given choice item is None - if the given choice item has already been closed - if the given choice item is already present in this list - if the given choice item does not belong to the list box field’s choice items
Removing items or clearing the list results in an IllegalState error if the form field is marked as read-only, or if it has widgets.
- Returns:
pdftools_toolbox.pdf.forms.choice_item_list.ChoiceItemList
- 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