FormWidgetInfo


class FormWidgetInfo : Parcelable


Information about a form widget of a PDF document.

Summary

Constants

const Int

Represents a checkbox type form widget

const Int

Represents a combobox type form widget

const Int

Represents a listbox type form widget

const Int

Represents a push button type form widget

const Int

Represents a radio button type form widget

const Int

Represents a signature type form widget

const Int

Represents a text field type form widget

const Int

Represents a form widget type that is unknown

Public companion functions

FormWidgetInfo
createCheckbox(
    widgetIndex: @IntRange(from = 0) Int,
    widgetRect: Rect,
    textValue: String?,
    accessibilityLabel: String?,
    isReadOnly: Boolean
)

Factory method for creating form widget of type WIDGET_TYPE_CHECKBOX.

FormWidgetInfo
createComboBox(
    widgetIndex: @IntRange(from = 0) Int,
    widgetRect: Rect,
    textValue: String?,
    accessibilityLabel: String?,
    isReadOnly: Boolean,
    isEditableText: Boolean,
    fontSize: @FloatRange(from = 0.0) Float,
    listItems: List<ListItem>
)

Factory method for creating form widget of type WIDGET_TYPE_COMBOBOX.

FormWidgetInfo
createListBox(
    widgetIndex: @IntRange(from = 0) Int,
    widgetRect: Rect,
    textValue: String?,
    accessibilityLabel: String?,
    isReadOnly: Boolean,
    isMultiSelect: Boolean,
    listItems: List<ListItem>
)
FormWidgetInfo
createPushButton(
    widgetIndex: @IntRange(from = 0) Int,
    widgetRect: Rect,
    textValue: String?,
    accessibilityLabel: String?,
    isReadOnly: Boolean
)

Factory method for creating form widget of type WIDGET_TYPE_PUSHBUTTON.

FormWidgetInfo
createRadioButton(
    widgetIndex: @IntRange(from = 0) Int,
    widgetRect: Rect,
    textValue: String?,
    accessibilityLabel: String?,
    isReadOnly: Boolean
)

Factory method for creating form widget of type WIDGET_TYPE_RADIOBUTTON.

FormWidgetInfo
createSignature(
    widgetIndex: @IntRange(from = 0) Int,
    widgetRect: Rect,
    textValue: String?,
    accessibilityLabel: String?,
    isReadOnly: Boolean
)

Factory method for creating form widget of type WIDGET_TYPE_SIGNATURE.

FormWidgetInfo
createTextField(
    widgetIndex: @IntRange(from = 0) Int,
    widgetRect: Rect,
    textValue: String?,
    accessibilityLabel: String?,
    isReadOnly: Boolean,
    isEditableText: Boolean,
    isMultiLineText: Boolean,
    maxLength: @IntRange(from = 0) Int,
    fontSize: @FloatRange(from = 0.0) Float
)

Factory method for creating form widget of type WIDGET_TYPE_TEXTFIELD.

Public companion properties

Parcelable.Creator<FormWidgetInfo>

Public functions

open Int
open operator Boolean
equals(other: Any?)
open Int
open Unit
writeToParcel(dest: Parcel, flags: Int)

Public properties

String?

The accessibility label for this widget, if present.

Float

The configured font size for a form widget that accepts text input (WIDGET_TYPE_COMBOBOX or WIDGET_TYPE_TEXTFIELD), or 0 for widgets this does not apply to.

Boolean

True if this widget has editable text.

Boolean

True if this widget supports multi-line text input.

Boolean

True if this widget supports selecting multiple ListItems.

Boolean

True if this widget is read-only and accepts changes

List<ListItem>

The set of choice options in a form widget of type WIDGET_TYPE_COMBOBOX or WIDGET_TYPE_LISTBOX, or an empty list for other widget types.

Int

The configured maximum text length for a form widget of type WIDGET_TYPE_TEXTFIELD), or -1 for widgets this does not apply to.

String?

The text value of this widget, if present.

Int

The index of this widget among all form widgets on the page

Rect

The bounds of this widget in PDF coordinates

Int

The WidgetType of this widget

Constants

WIDGET_TYPE_CHECKBOX

const val WIDGET_TYPE_CHECKBOX = 2: Int

Represents a checkbox type form widget

WIDGET_TYPE_COMBOBOX

const val WIDGET_TYPE_COMBOBOX = 4: Int

Represents a combobox type form widget

WIDGET_TYPE_LISTBOX

const val WIDGET_TYPE_LISTBOX = 5: Int

Represents a listbox type form widget

WIDGET_TYPE_PUSHBUTTON

const val WIDGET_TYPE_PUSHBUTTON = 1: Int

Represents a push button type form widget

WIDGET_TYPE_RADIOBUTTON

const val WIDGET_TYPE_RADIOBUTTON = 3: Int

Represents a radio button type form widget

WIDGET_TYPE_SIGNATURE

const val WIDGET_TYPE_SIGNATURE = 7: Int

Represents a signature type form widget

WIDGET_TYPE_TEXTFIELD

const val WIDGET_TYPE_TEXTFIELD = 6: Int

Represents a text field type form widget

WIDGET_TYPE_UNKNOWN

const val WIDGET_TYPE_UNKNOWN = 0: Int

Represents a form widget type that is unknown

Public companion functions

createCheckbox

Added in 1.0.0-alpha13
fun createCheckbox(
    widgetIndex: @IntRange(from = 0) Int,
    widgetRect: Rect,
    textValue: String?,
    accessibilityLabel: String?,
    isReadOnly: Boolean
): FormWidgetInfo

Factory method for creating form widget of type WIDGET_TYPE_CHECKBOX.

createComboBox

Added in 1.0.0-alpha13
fun createComboBox(
    widgetIndex: @IntRange(from = 0) Int,
    widgetRect: Rect,
    textValue: String?,
    accessibilityLabel: String?,
    isReadOnly: Boolean,
    isEditableText: Boolean,
    fontSize: @FloatRange(from = 0.0) Float,
    listItems: List<ListItem>
): FormWidgetInfo

Factory method for creating form widget of type WIDGET_TYPE_COMBOBOX.

createListBox

Added in 1.0.0-alpha13
fun createListBox(
    widgetIndex: @IntRange(from = 0) Int,
    widgetRect: Rect,
    textValue: String?,
    accessibilityLabel: String?,
    isReadOnly: Boolean,
    isMultiSelect: Boolean,
    listItems: List<ListItem>
): FormWidgetInfo

createPushButton

Added in 1.0.0-alpha13
fun createPushButton(
    widgetIndex: @IntRange(from = 0) Int,
    widgetRect: Rect,
    textValue: String?,
    accessibilityLabel: String?,
    isReadOnly: Boolean
): FormWidgetInfo

Factory method for creating form widget of type WIDGET_TYPE_PUSHBUTTON.

createRadioButton

Added in 1.0.0-alpha13
fun createRadioButton(
    widgetIndex: @IntRange(from = 0) Int,
    widgetRect: Rect,
    textValue: String?,
    accessibilityLabel: String?,
    isReadOnly: Boolean
): FormWidgetInfo

Factory method for creating form widget of type WIDGET_TYPE_RADIOBUTTON.

createSignature

Added in 1.0.0-alpha13
fun createSignature(
    widgetIndex: @IntRange(from = 0) Int,
    widgetRect: Rect,
    textValue: String?,
    accessibilityLabel: String?,
    isReadOnly: Boolean
): FormWidgetInfo

Factory method for creating form widget of type WIDGET_TYPE_SIGNATURE.

createTextField

Added in 1.0.0-alpha13
fun createTextField(
    widgetIndex: @IntRange(from = 0) Int,
    widgetRect: Rect,
    textValue: String?,
    accessibilityLabel: String?,
    isReadOnly: Boolean,
    isEditableText: Boolean,
    isMultiLineText: Boolean,
    maxLength: @IntRange(from = 0) Int,
    fontSize: @FloatRange(from = 0.0) Float
): FormWidgetInfo

Factory method for creating form widget of type WIDGET_TYPE_TEXTFIELD.

Public companion properties

Public functions

describeContents

Added in 1.0.0-alpha13
open fun describeContents(): Int

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

writeToParcel

Added in 1.0.0-alpha13
open fun writeToParcel(dest: Parcel, flags: Int): Unit

Public properties

accessibilityLabel

Added in 1.0.0-alpha13
val accessibilityLabelString?

The accessibility label for this widget, if present. Comes from the "TU" or "T" value in the annotation dictionary.

See PDF spec 1.7 Table 8.69

fontSize

Added in 1.0.0-alpha13
val fontSizeFloat

The configured font size for a form widget that accepts text input (WIDGET_TYPE_COMBOBOX or WIDGET_TYPE_TEXTFIELD), or 0 for widgets this does not apply to.

isEditableText

Added in 1.0.0-alpha13
val isEditableTextBoolean

True if this widget has editable text. Only applicable to WIDGET_TYPE_COMBOBOX or WIDGET_TYPE_TEXTFIELD. Defaults to 'false' for other widget types.

isMultiLineText

Added in 1.0.0-alpha13
val isMultiLineTextBoolean

True if this widget supports multi-line text input. Only applicable to WIDGET_TYPE_TEXTFIELD. Defaults to 'false' for other widget types.

isMultiSelect

Added in 1.0.0-alpha13
val isMultiSelectBoolean

True if this widget supports selecting multiple ListItems. Only applicable to WIDGET_TYPE_LISTBOX. Defaults to 'false' for other widget types.

isReadOnly

Added in 1.0.0-alpha13
val isReadOnlyBoolean

True if this widget is read-only and accepts changes

listItems

Added in 1.0.0-alpha13
val listItemsList<ListItem>

The set of choice options in a form widget of type WIDGET_TYPE_COMBOBOX or WIDGET_TYPE_LISTBOX, or an empty list for other widget types.

maxLength

Added in 1.0.0-alpha13
val maxLengthInt

The configured maximum text length for a form widget of type WIDGET_TYPE_TEXTFIELD), or -1 for widgets this does not apply to.

textValue

Added in 1.0.0-alpha13
val textValueString?

The text value of this widget, if present. Comes from the "V" value in the annotation dictionary.

See PDF spec 1.7 Table 8.69

widgetIndex

Added in 1.0.0-alpha13
val widgetIndexInt

The index of this widget among all form widgets on the page

widgetRect

Added in 1.0.0-alpha13
val widgetRectRect

The bounds of this widget in PDF coordinates

widgetType

Added in 1.0.0-alpha13
val widgetTypeInt

The WidgetType of this widget