Class CPDFTextWidget
java.lang.Object
com.compdfkit.core.annotation.CPDFAnnotation
com.compdfkit.core.annotation.form.CPDFWidget
com.compdfkit.core.annotation.form.CPDFTextWidget
A text form field in a PDF form. Allows the user to enter custom text.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumTypes of text field.Nested classes/interfaces inherited from class com.compdfkit.core.annotation.form.CPDFWidget
CPDFWidget.BorderStyle, CPDFWidget.CheckStyle, CPDFWidget.WidgetTypeNested classes/interfaces inherited from class com.compdfkit.core.annotation.CPDFAnnotation
CPDFAnnotation.AppearanceType, CPDFAnnotation.PSOAnnotationState, CPDFAnnotation.Type -
Method Summary
Modifier and TypeMethodDescriptionintGets the font color of text content in TextField.Gets the text content font in TextField, get the font type in according to font names.floatGets the font size of text content in TextField.getText()Gets the text content in TextField.Gets the the text alignment in TextField, more:CPDFTextAlignmentGets the content format of TextField, format type:CPDFTextWidget.TextFiledSpecialbooleanWhether to display multiline PDF text fields.booleanWhether the TextField content display password, password :*****booleanResets TextField forms, content of TextField is cleared upbooleansetFontColor(int color) Sets the font color of text content in TextField.booleansetFontName(String fontName) Sets the font format of text content, get the font name.booleansetFontSize(float fontsize) Sets the font size of text content in TextField.booleansetMultiLine(boolean isMultiLine) Sets to display multiline PDF text fields.booleanSets the text content in TextField.booleansetTextAlignment(CPDFTextAlignment alignment) Sets the text alignment in TextField, more:CPDFTextAlignmentbooleansetTextFieldSpecial(boolean isDateSpecial) Sets the content format of TextField, format type:CPDFTextWidget.TextFiledSpecialMethods inherited from class com.compdfkit.core.annotation.form.CPDFWidget
clearBorderColor, clearFillColor, getBorderColor, getBorderStyles, getBorderWidth, getCheckStyle, getFieldFlag, getFieldName, getFieldType, getFillAlpha, getFillColor, getRect, getWidgetType, isReadOnly, setBorderColor, setBorderStyles, setBorderWidth, setCheckStyle, setFieldFlag, setFieldName, setFieldType, setFillAlpha, setFillColor, setReadOnly, setRect, updateAp, updateApMethods inherited from class com.compdfkit.core.annotation.CPDFAnnotation
addToPage, close, createReplyAnnotation, createReplyStateAnnotation, getContent, getCreationDate, getFlags, getMainAnnotNM, getName, getRecentlyModifyDate, getReplies, getState, getTitle, getType, hasAp, isAllowCorrectAnnotationAp, isExitMainAnnot, isHidden, isLocked, isMarkedStateAnnot, isReplyAnnot, isReviewStateAnnot, isValid, removeFromPage, removeFromPageIncludeReplyAnnot, setAllowCorrectAnnotationAp, setContent, setCreationDate, setFlags, setHidden, setLocked, setMarkedAnnotState, setName, setRecentlyModifyDate, setReviewAnnotState, setState, setTitle
-
Method Details
-
setText
Sets the text content in TextField.- Parameters:
text- Text content.- Returns:
- Returns whether to successfully set the text content in TextField.
-
getText
Gets the text content in TextField.- Returns:
- Returns the text content in TextField.
-
isMultiLine
public boolean isMultiLine()Whether to display multiline PDF text fields.- Returns:
- Returns whether to display multiline PDF text fields.
-
setMultiLine
public boolean setMultiLine(boolean isMultiLine) Sets to display multiline PDF text fields.- Parameters:
isMultiLine- Whether to display multiline PDF text fields.- Returns:
- Returns whether to successfully display multiline PDF text fields.
-
isPassword
public boolean isPassword()Whether the TextField content display password, password :*****- Returns:
- Returns whether the TextField content display password.
-
setFontName
Sets the font format of text content, get the font name.- Parameters:
fontName- Font name of text.- Returns:
- Whether to successfully set the text content font in TextField.
-
getFontName
Gets the text content font in TextField, get the font type in according to font names. Whether the font is italic according to font names- Returns:
- Returns font names in TextField
-
setFontSize
public boolean setFontSize(float fontsize) Sets the font size of text content in TextField.- Parameters:
fontsize- Font size.- Returns:
- Returns whether to successfully set the font size of text.
-
getFontSize
public float getFontSize()Gets the font size of text content in TextField.- Returns:
- Returns the font size of text content in TextField.
-
setFontColor
public boolean setFontColor(int color) Sets the font color of text content in TextField.- Parameters:
color- Text color.- Returns:
- Returns whether to set text color successfully.
-
getFontColor
public int getFontColor()Gets the font color of text content in TextField.- Returns:
- Returns the font color of text content in TextField.
-
setTextAlignment
Sets the text alignment in TextField, more:CPDFTextAlignment- Parameters:
alignment- Alignment.- Returns:
- Returns whether to successfully set the text alignment.
-
getTextAlignment
Gets the the text alignment in TextField, more:CPDFTextAlignment- Returns:
- Returns text alignment.
-
setTextFieldSpecial
public boolean setTextFieldSpecial(boolean isDateSpecial) Sets the content format of TextField, format type:CPDFTextWidget.TextFiledSpecial- Parameters:
isDateSpecial- Whether to be date format.- Returns:
- Returns whether to successfully set content format of TextField.
-
getTextFieldSpecial
Gets the content format of TextField, format type:CPDFTextWidget.TextFiledSpecial- Returns:
- Returns the content format of TextField.
-
resetForm
public boolean resetForm()Resets TextField forms, content of TextField is cleared up- Overrides:
resetFormin classCPDFWidget- Returns:
- Returns whether to successfully reset TextField forms.
-