pdftools_toolbox.pdf.forms.comb_text_field

Classes

CombTextField(handle)

A fixed pitch text field

class pdftools_toolbox.pdf.forms.comb_text_field.CombTextField(handle)[source]

Bases: TextField

A fixed pitch text field

In a comb text field, the pdftools_toolbox.pdf.forms.general_text_field.GeneralTextField.max_length must be defined. The glyphs displayed are placed in pdftools_toolbox.pdf.forms.general_text_field.GeneralTextField.max_length equally spaced cells.

static create(target_document: Document, max_length: int) CombTextField[source]

Create a comb text 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

  • maxLength (int) – the maximal character length for this field

Returns:

the newly created comb text field

Return type:

pdftools_toolbox.pdf.forms.comb_text_field.CombTextField

Raises:
property max_length: int

The maximal text length

When setting this property, the length of this field’s text is truncated to the given value.

Returns:

int

Raises:

StateError – if the object has already been closed