pdftools_toolbox.pdf.forms.radio_button_group
Classes
|
A radio button field |
- class pdftools_toolbox.pdf.forms.radio_button_group.RadioButtonGroup(handle)[source]
Bases:
Field
A radio button field
- static create(target_document: Document) → RadioButtonGroup[source]
Create a radio button 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 radio button field
- Return type:
pdftools_toolbox.pdf.forms.radio_button_group.RadioButtonGroup
- 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
.
- add_new_button(export_name: str | None) → RadioButton[source]
Create a radio button
The created radio button is automatically added to this radio button field’s
pdftools_toolbox.pdf.forms.radio_button_group.RadioButtonGroup.buttons
.- Parameters:
exportName (Optional[str]) – the radio button’s export name
- Returns:
the newly created radio button
- Return type:
- Raises:
StateError – if the document has already been closed
OperationError – if the document is read-only
- property buttons: RadioButtonList
This field’s buttons
- Returns:
pdftools_toolbox.pdf.forms.radio_button_list.RadioButtonList
- Raises:
StateError – if the object has already been closed
- property chosen_button: RadioButton | None
This field’s selected button
if None is set, then no button is chosen.
- Returns:
Optional[pdftools_toolbox.pdf.forms.radio_button.RadioButton]
- Raises:
StateError – if the object has already been closed