Class CPDFWidget
java.lang.Object
com.compdfkit.core.annotation.CPDFAnnotation
com.compdfkit.core.annotation.form.CPDFWidget
- Direct Known Subclasses:
CPDFCheckboxWidget,CPDFPushbuttonWidget,CPDFRadiobuttonWidget,CPDFSignatureWidget,CPDFTextWidget,CPDFWidgetItems
A visible form control. Every form element has a single parent CPDFWidget. Each form element is associated with a single CPDFAnnotation that is a visual representation of the form element in the document.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumBorder style for the form.static enumFill type of CheckBox and Radiobutton.static enumForm types.Nested classes/interfaces inherited from class com.compdfkit.core.annotation.CPDFAnnotation
CPDFAnnotation.AppearanceType, CPDFAnnotation.PSOAnnotationState, CPDFAnnotation.Type -
Method Summary
Modifier and TypeMethodDescriptionbooleanClear the border color of the form.booleanClear the background color of the form.intGets the border color of the form.Gets the border style of the form.floatGets the border width of the form.Gets the check style of CheckBox or Radiobutton.intGets form flag.Gets internal name for the field.Not in use currentlyfloatGets the background opacity of the form.intGets the background color of the form.getRect()Gets annotation rectangle.Gets form types, refer to:CPDFWidget.WidgetTypebooleanbooleanResets forms.booleansetBorderColor(int color) Sets the border color of the form.booleansetBorderStyles(CPDFWidget.BorderStyle borderStyle) Sets border style of the form.booleansetBorderWidth(float width) Sets the border width of the form.booleansetCheckStyle(CPDFWidget.CheckStyle checkStyle) Sets the check style of CheckBox or Radiobutton.booleansetFieldFlag(int flag) Sets form flag.booleansetFieldName(String fieldName) Sets internal name for the field.booleansetFieldType(String fieldType) Not in use currentlybooleansetFillAlpha(float filledTransparency) Sets the background opacity of the form.booleansetFillColor(int color) Sets the background color of the form.booleansetReadOnly(boolean isReadOnly) booleanSets annotation rectangle.booleanupdateAp()The updated form appearance does not support transparency.booleanupdateAp(boolean supportTransparency) Updates custom form appearance.Methods 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
-
getWidgetType
Gets form types, refer to:CPDFWidget.WidgetType- Returns:
- Returns form types.
-
setFieldName
Sets internal name for the field.- Parameters:
fieldName- Internal name for the field.- Returns:
- Whether to successfully set internal name for the field.
-
getFieldName
Gets internal name for the field.- Returns:
- Returns internal name for the field.
-
setFieldFlag
public boolean setFieldFlag(int flag) Sets form flag.- Parameters:
flag- Form flag.- Returns:
- Whether to successfully set form flag.
-
getFieldFlag
public int getFieldFlag()Gets form flag.- Returns:
- Returns form flag.
-
isReadOnly
public boolean isReadOnly() -
setReadOnly
public boolean setReadOnly(boolean isReadOnly) -
setFieldType
Not in use currently- Parameters:
fieldType- Form type- Returns:
- Whether to successfully set form type.
-
getFieldType
Not in use currently- Returns:
- Form type
-
setFillColor
public boolean setFillColor(int color) Sets the background color of the form.- Parameters:
color- Background color.- Returns:
- Returns whether to successfully set background color for the form.
-
getFillColor
public int getFillColor()Gets the background color of the form.- Returns:
- Returns the background color of the form.
-
clearFillColor
public boolean clearFillColor()Clear the background color of the form.- Returns:
- Returns a value of boolean:whether to successfully clear the background.
-
setBorderColor
public boolean setBorderColor(int color) Sets the border color of the form.- Parameters:
color- Border color.- Returns:
- Whether to successfully set border color value of the form.
-
getBorderColor
public int getBorderColor()Gets the border color of the form.- Returns:
- Returns the background color of the form.
-
clearBorderColor
public boolean clearBorderColor()Clear the border color of the form.- Returns:
- Returns value of boolean:whether to successfully clear the border color of the form.
-
setBorderStyles
Sets border style of the form.- Parameters:
borderStyle- Border style of the form.- Returns:
- Returns whether to successfully set border style of the form.
-
getBorderStyles
Gets the border style of the form.- Returns:
- Returns the border style of the form.
-
setCheckStyle
Sets the check style of CheckBox or Radiobutton.- Parameters:
checkStyle- Check style of CheckBox or Radiobutton.- Returns:
- Returns whether to successfully set the check style of CheckBox or Radiobutton.
-
getCheckStyle
Gets the check style of CheckBox or Radiobutton.- Returns:
- Returns the check style of CheckBox or Radiobutton
-
getBorderWidth
public float getBorderWidth()Gets the border width of the form.- Returns:
- Returns the border width of the form.
-
setBorderWidth
public boolean setBorderWidth(float width) Sets the border width of the form.- Parameters:
width- Border width of the form.- Returns:
- Returns whether to successfully set the border width of the form.
-
setFillAlpha
public boolean setFillAlpha(float filledTransparency) Sets the background opacity of the form.- Parameters:
filledTransparency- Opacity value. Value range 0-1.- Returns:
- Returns whether to successfully set the background opacity of the form.
-
getFillAlpha
public float getFillAlpha()Gets the background opacity of the form.- Returns:
- Returns the background opacity value of the form, Value range 0-1.
-
updateAp
public boolean updateAp()The updated form appearance does not support transparency.- Returns:
- Returns whether to successfully update form appearance.
-
updateAp
public boolean updateAp(boolean supportTransparency) Updates custom form appearance.- Parameters:
supportTransparency- Whether to support opacity.- Returns:
- Returns whether to successfully update form appearance.
-
resetForm
public boolean resetForm()Resets forms.- Returns:
- Returns whether to reset forms.
-
setRect
Sets annotation rectangle. The page coordinate system has its origin at the left-bottom corner of the page, with the X-axis on the bottom going to the right, and the Y-axis on the left side going up. The device coordinate system is device dependent. For screen device, its origin is at the left-top corner of the window.- Overrides:
setRectin classCPDFAnnotation- Parameters:
rect- Rectangle on the page.- Returns:
- Returns whether to successfully set annotation rectangle.
-
getRect
Gets annotation rectangle. The page coordinate system has its origin at the left-bottom corner of the page, with the X-axis on the bottom going to the right, and the Y-axis on the left side going up. The device coordinate system is device dependent. For screen device, its origin is at the left-top corner of the window.- Overrides:
getRectin classCPDFAnnotation- Returns:
- Returns rectangle on the page.
-