Package com.pdftools.toolbox.pdf.forms
Class CombTextField
- java.lang.Object
-
public class CombTextField extends TextField
A fixed pitch text field
In a comb text field, theGeneralTextField.getMaxLength()
must be defined. The glyphs displayed are placed inGeneralTextField.getMaxLength()
equally spaced cells.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CombTextField
create(Document targetDocument, int maxLength)
Create a comb text form fieldint
getMaxLength()
The maximal text length (Getter)void
setMaxLength(int value)
The maximal text length (Setter)-
Methods inherited from class com.pdftools.toolbox.pdf.forms.TextField
getAlignment, getFontSize, getText, setAlignment, setFontSize, setText
-
Methods inherited from class com.pdftools.toolbox.pdf.forms.Field
addNewWidget, getDoNotExport, getReadOnly, getRequired, getWidgets, setDoNotExport, setReadOnly, setRequired
-
Methods inherited from class com.pdftools.toolbox.pdf.forms.FieldNode
copy, getDisplayName, getExportName, setDisplayName, setExportName
-
Methods inherited from class com.pdftools.toolbox.internal.NativeObject
equals, hashCode
-
-
-
-
Method Detail
-
create
public static CombTextField create(Document targetDocument, int maxLength)
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
- the output document with which the returned object is associatedmaxLength
- the maximal character length for this field- Returns:
- the newly created comb text field
- Throws:
java.lang.IllegalArgumentException
- if thetargetDocument
argument has already been closedjava.lang.IllegalArgumentException
- if thetargetDocument
argument is read-onlyjava.lang.IllegalArgumentException
- the target document contains form fields that have been implicitly copied by a call totoolbox.pdf.Page.copy
with an argumentoptions
in whichtoolbox.pdf.PageCopyOptions.setFormFields
was set toFormFieldCopyStrategy.COPY
java.lang.IllegalArgumentException
- the target document contains unsigned signatures that have been implicitly copied by a call totoolbox.pdf.Page.copy
with an argumentoptions
in whichtoolbox.pdf.PageCopyOptions.setUnsignedSignatures
was set totoolbox.pdf.CopyStrategy.COPY
.java.lang.IllegalArgumentException
- ifmaxLength
is smaller than 0java.lang.IllegalArgumentException
- iftargetDocument
isnull
-
getMaxLength
public int getMaxLength()
The maximal text length (Getter)
When setting this property, the length of this field's text is truncated to the given value.- Throws:
java.lang.IllegalStateException
- if the object has already been closed
-
setMaxLength
public void setMaxLength(int value)
The maximal text length (Setter)
When setting this property, the length of this field's text is truncated to the given value.- Throws:
java.lang.IllegalStateException
- if the object has already been closedjava.lang.UnsupportedOperationException
- if the document is read-onlyjava.lang.IllegalStateException
- if the form field has widgetsjava.lang.IllegalArgumentException
- if the given value is smaller than 0
-
-