pdftools_toolbox.pdf.forms.radio_button_group

Classes

RadioButtonGroup(handle)

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:
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:

pdftools_toolbox.pdf.forms.radio_button.RadioButton

Raises:
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