Signature

data class Signature(val annotationType: AnnotationType = AnnotationType.INK, 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 signatureDrawWidthRatio: Float = 1.0f, val bitmapIdentifier: Int = BITMAP_NOT_SET, val stampRect: RectF? = null) : Parcelable

Represents a single signature (or signature item). To create an InkAnnotation or StampAnnotation from this signature use the toInkAnnotation and toStampAnnotation methods. You can check the signature annotation type through annotationType.

Constructors

Link copied to clipboard
constructor(annotationType: AnnotationType = AnnotationType.INK, id: Long = ID_NOT_SET, inkColor: Int = 0, lineWidth: Float = 0.0f, lines: List<List<PointF>> = emptyList(), biometricData: BiometricSignatureData? = null, signatureDrawWidthRatio: Float = 1.0f, bitmapIdentifier: Int = BITMAP_NOT_SET, stampRect: RectF? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The annotation type of the signature, which can either be InkAnnotation or StampAnnotation. Useful for getting the correct type through toInkAnnotation and toStampAnnotation.

Link copied to clipboard

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

Link copied to clipboard
Link copied to clipboard

The bitmap identifier used for rendering the image signature, or BITMAP_NOT_SET if the signature is not represented by a bitmap.

Link copied to clipboard
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

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

Link copied to clipboard
val stampRect: RectF? = null

Bounding rectangle for this signature's bitmap.

Functions

Link copied to clipboard
fun toInkAnnotation(@IntRange(from = 0) pageIndex: Int): InkAnnotation

Builds ink annotation from signature data. This method does not set annotation's bounding box. If you want to create a stamp annotation with bounding box around certain touch point, use .toInkAnnotation instead.

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

Builds ink annotation 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.

Link copied to clipboard
fun toStampAnnotation(@IntRange(from = 0) pageIndex: Int): StampAnnotation

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

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

Builds stamp annotation from signature data.