pdftools_toolbox.pdf.forms.field

Classes

Field(handle)

A form field

class pdftools_toolbox.pdf.forms.field.Field(handle)[source]

Bases: FieldNode, ABC

A form field

add_new_widget(bounding_box: Rectangle) Widget[source]

Create a new widget and add to the form field

This method creates a widget for the form field. The widget is automatically added to the field’s widgets, but not to any page. This method does not work for radio button form fields; Use pdftools_toolbox.pdf.forms.radio_button.RadioButton.add_new_widget() .

Parameters:

boundingBox (pdftools_toolbox.geometry.real.rectangle.Rectangle) – The widget’s target rectangle on the page

Returns:

the newly created form field widget

Return type:

pdftools_toolbox.pdf.forms.widget.Widget

Raises:
property widgets: WidgetList

This form field’s widget annotations

Returns:

pdftools_toolbox.pdf.forms.widget_list.WidgetList

Raises:

StateError – if the object has already been closed

property read_only: bool

Flags this field as read-only

Returns:

bool

Raises:

StateError – if the object has already been closed

property required: bool

Flags this field as mandatory

Returns:

bool

Raises:

StateError – if the object has already been closed

property do_not_export: bool

Tells whether this field is exported

Returns:

bool

Raises:

StateError – if the object has already been closed