pdftools_toolbox.pdf.forms.comb_text_field
Classes
|
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 inpdftools_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:
- 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
.ValueError – if maxLength is smaller than 0
- 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