Class CPDFSignatureWidget
java.lang.Object
com.compdfkit.core.annotation.CPDFAnnotation
com.compdfkit.core.annotation.form.CPDFWidget
com.compdfkit.core.annotation.form.CPDFSignatureWidget
Represents a signature field in a form. This is usually used to place a signature onto a page using an TPDFInkAnnotation.
-
Nested Class Summary
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 TypeMethodDescriptionbooleancheckSignatureToWidget(CPDFSignature signature) Whether the widget corresponds to the signature.longgetSignature(CPDFDocument document) Get the signature of the signature widget.booleanisSigned()Whether signature form is signed.booleanResets forms.booleanSets Signature form as signed.booleanupdateApWithBitmap(int[] pixels, int width, int height) Updates form appearance by Bitmap.booleanupdateApWithBitmap(int[] pixels, int width, int height, CPDFImageScaleType imageScaleType) Updates form appearance by Bitmap.booleanUpdate AP of the signature Widget.booleanupdateApWithImage(String imagePath, String smaskPath, CPDFImageScaleType imageScaleType) Updates form appearance by image.booleanupdateApWithInk(PointF[][] path, float width, int color) Updates form appearance by Ink.booleanupdateApWithText(String text, String fontName, int color) Updates form appearance by text.Methods 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
-
isSigned
public boolean isSigned()Whether signature form is signed.- Returns:
- Signature Returns whether signature form is signed.
-
getAnnotPtr
public long getAnnotPtr() -
updateApWithText
Updates form appearance by text.- Parameters:
text- Text content of signaturefontName- Font name of signature textcolor- Text color.- Returns:
- Returns whether to successfully update form appearance by text.
-
updateApWithImage
public boolean updateApWithImage(String imagePath, String smaskPath, CPDFImageScaleType imageScaleType) Updates form appearance by image.- Parameters:
imagePath- Original image path, image format must bejpeg,jpgsmaskPath- Mask path, image format must bejpeg,jpgimageScaleType- The zoom rule for filling the image into the form, more:CPDFImageScaleType- Returns:
- Returns whether to successfully update form appearance by image.
-
updateApWithBitmap
public boolean updateApWithBitmap(int[] pixels, int width, int height, CPDFImageScaleType imageScaleType) Updates form appearance by Bitmap.- Parameters:
pixels- Image pixels.width- Image width.height- Image height.imageScaleType- The zoom rule for filling the image into the form, more:CPDFImageScaleType- Returns:
- Returns whether to successfully update form appearance by Bitmap.
-
updateApWithInk
Updates form appearance by Ink. -
updateApWithBitmap
public boolean updateApWithBitmap(int[] pixels, int width, int height) Updates form appearance by Bitmap.- Parameters:
pixels- Image pixels.width- Image width.height- Image height.- Returns:
- Returns whether to successfully update form appearance by Bitmap.
-
signWithName
public boolean signWithName()Sets Signature form as signed.- Returns:
- Returns whether to successfully set Signature form as signed.
-
resetForm
public boolean resetForm()Resets forms.- Overrides:
resetFormin classCPDFWidget- Returns:
- Returns whether to successfully reset forms.
-
updateApWithDigitalSigConfig
Update AP of the signature Widget.- Parameters:
config- Config data of the new AP.- Returns:
- Returns true:update succeed, false:fail.
-
getSignature
Get the signature of the signature widget.- Parameters:
document- CPDFDocument- Returns:
- Returns the signature of the signature widget.
-
checkSignatureToWidget
Whether the widget corresponds to the signature.- Parameters:
signature- Signature- Returns:
- Returns true:correspond, false:not correspond.
-