Signature

data class Signature(val id: Long = ID_NOT_SET, val inkColor: Int = 0, val lineWidth: Float = 0.0f, val lines: List<List<PointF>> = emptyList(), val biometricData: BiometricSignatureData? = null, val drawWidthRatio: Float = 1.0f, val bitmap: Bitmap? = null, val stampRect: RectF? = null) : Parcelable

Represents a single signature (or signature item). To create an Annotation from this signature use the toAnnotation methods. Helper methods to create Ink or Stamp Signatures are here: createStampSignature, createInkSignature.

Constructors

Link copied to clipboard
constructor(id: Long = ID_NOT_SET, inkColor: Int = 0, lineWidth: Float = 0.0f, lines: List<List<PointF>> = emptyList(), biometricData: BiometricSignatureData? = null, drawWidthRatio: Float = 1.0f, bitmap: Bitmap? = null, stampRect: RectF? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

BiometricSignatureData that was collected with this signature. May return null if no biometric data was created.

Link copied to clipboard
val bitmap: Bitmap? = null

When creating a stamp signature (as opposed to ink signature), you need to provide a bitmap.

Link copied to clipboard
Link copied to clipboard
val drawWidthRatio: Float = 1.0f

The ratio of signature width to width of the drawing view used when drawing the signature.

Link copied to clipboard
val id: Long

Signature id number used in signature database. If not set, the default value is ID_NOT_SET.

Link copied to clipboard
val inkColor: Int = 0

Colour of the ink signature

Link copied to clipboard

List of ink lines in pdf points.

Link copied to clipboard
val lineWidth: Float = 0.0f

Signature line width in pdf points.

Link copied to clipboard
val stampRect: RectF? = null

Bounding rectangle for this signature's bitmap.

Functions

Link copied to clipboard
fun toAnnotation(@IntRange(from = 0) pageIndex: Int): Annotation

Builds InkAnnotation or StampAnnotation from signature data. If you want to create a stamp annotation with a specific bounding box around certain touch point, use toAnnotation instead.

fun toAnnotation(document: PdfDocument, @IntRange(from = 0) pageIndex: Int, touchPoint: PointF): Annotation
fun toAnnotation(document: PdfDocument, @IntRange(from = 0) pageIndex: Int, targetRect: RectF): Annotation

Builds InkAnnotation or StampAnnotation from signature data.

Link copied to clipboard

Converts a signature into a JSON object. You can use that JSON object to recreate the signature later on via fromJson.