Class CPDFSignatureWidget


public class CPDFSignatureWidget extends CPDFWidget
Represents a signature field in a form. This is usually used to place a signature onto a page using an TPDFInkAnnotation.
  • Method Details

    • isSigned

      public boolean isSigned()
      Whether signature form is signed.
      Returns:
      Signature Returns whether signature form is signed.
    • getAnnotPtr

      public long getAnnotPtr()
    • updateApWithText

      public boolean updateApWithText(String text, String fontName, int color)
      Updates form appearance by text.
      Parameters:
      text - Text content of signature
      fontName - Font name of signature text
      color - 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, jpg
      smaskPath - Mask path, image format must bejpeg, jpg
      imageScaleType - 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

      public boolean updateApWithInk(PointF[][] path, float width, int color)
      Updates form appearance by Ink.
      Parameters:
      path - Points collection on the path, PointF means one line, PointF means multiple lines.
      width - Line width.
      color - Line color.
      Returns:
      Returns whether to successfully update form appearance by notes.
    • 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:
      resetForm in class CPDFWidget
      Returns:
      Returns whether to successfully reset forms.
    • updateApWithDigitalSigConfig

      public boolean updateApWithDigitalSigConfig(CPDFDigitalSigConfig config)
      Update AP of the signature Widget.
      Parameters:
      config - Config data of the new AP.
      Returns:
      Returns true:update succeed, false:fail.
    • getSignature

      public CPDFSignature getSignature(CPDFDocument document)
      Get the signature of the signature widget.
      Parameters:
      document - CPDFDocument
      Returns:
      Returns the signature of the signature widget.
    • checkSignatureToWidget

      public boolean checkSignatureToWidget(CPDFSignature signature)
      Whether the widget corresponds to the signature.
      Parameters:
      signature - Signature
      Returns:
      Returns true:correspond, false:not correspond.