Represents a text form field in a PDF document. Text fields allow users to enter text from the keyboard.

from nutrient import PdfTextField

Methods

get_child

def get_child(self, index: int) -> PdfFormField

Parameters:

NameTypeDescription
indexint

Returns: PdfFormField


get_widget

def get_widget(self, index: int) -> PdfWidgetAnnotation

Parameters:

NameTypeDescription
indexint

Returns: PdfWidgetAnnotation


remove_child_at

def remove_child_at(self, index: int) -> None

Parameters:

NameTypeDescription
indexint

set_background_color

def set_background_color(self, value: Color) -> None

Sets the background color of the text field.

Parameters:

NameTypeDescription
valueColorThe value to set for the BackgroundColor property.

set_border_color

def set_border_color(self, value: Color) -> None

Sets the border color of the text field.

Parameters:

NameTypeDescription
valueColorThe value to set for the BorderColor property.

set_font_color

def set_font_color(self, value: Color) -> None

Sets the font color for the text field content.

Parameters:

NameTypeDescription
valueColorThe value to set for the FontColor property.

set_font_name

def set_font_name(self, value: str) -> None

Sets the font name for the text field content.

Parameters:

NameTypeDescription
valuestrThe value to set for the FontName property.

set_font_size

def set_font_size(self, value: float) -> None

Sets the font size for the text field content.

Parameters:

NameTypeDescription
valuefloatThe value to set for the FontSize property.

set_is_read_only

def set_is_read_only(self, value: bool) -> None

Parameters:

NameTypeDescription
valuebool

set_is_required

def set_is_required(self, value: bool) -> None

Parameters:

NameTypeDescription
valuebool

set_text

def set_text(self, value: str) -> None

Sets the text content of the field. This is an alias for the property.

Parameters:

NameTypeDescription
valuestrThe value to set for the Text property.

set_value

def set_value(self, value: str) -> None

Parameters:

NameTypeDescription
valuestr

Properties

background_color

@property
def background_color(self) -> Color

Gets the background color of the text field.

Type: Color

Read-only property.


border_color

@property
def border_color(self) -> Color

Gets the border color of the text field.

Type: Color

Read-only property.


child_count

@property
def child_count(self) -> int

Type: int

Read-only property.


default_value

@property
def default_value(self) -> str

Type: str

Read-only property.


field_type

@property
def field_type(self) -> PdfFormFieldType

Type: PdfFormFieldType

Read-only property.


font_color

@property
def font_color(self) -> Color

Gets the font color for the text field content.

Type: Color

Read-only property.


font_name

@property
def font_name(self) -> str

Gets the font name for the text field content.

Type: str

Read-only property.


font_size

@property
def font_size(self) -> float

Gets the font size for the text field content.

Type: float

Read-only property.


full_name

@property
def full_name(self) -> str

Type: str

Read-only property.


is_read_only

@property
def is_read_only(self) -> bool

Type: bool

Read-only property.


is_required

@property
def is_required(self) -> bool

Type: bool

Read-only property.


is_terminal

@property
def is_terminal(self) -> bool

Type: bool

Read-only property.


name

@property
def name(self) -> str

Type: str

Read-only property.


parent

@property
def parent(self) -> PdfFormField

Type: PdfFormField

Read-only property.


text

@property
def text(self) -> str

Gets the text content of the field. This is an alias for the property.

Type: str

Read-only property.


value

@property
def value(self) -> str

Type: str

Read-only property.


widget_count

@property
def widget_count(self) -> int

Type: int

Read-only property.