[]
        
(Showing Draft Content)

ButtonAppearance

DsPdfJS API v9.1.0


DsPdfJS API / ButtonAppearance

Class: ButtonAppearance

Represents the appearance of a WidgetAnnotation when it is linked with a push button or a signature field.

Extends

Accessors

caption

Get Signature

get caption(): string | null

Gets or sets the button's caption.

Returns

string | null

Set Signature

set caption(value): void

Gets or sets the button's caption.

Parameters
value

string | null

Returns

void


captionImageRelation

Get Signature

get captionImageRelation(): CaptionImageRelation

Gets or sets a value indicating how to position the button's caption relative to image.

Returns

CaptionImageRelation

Set Signature

set captionImageRelation(value): void

Gets or sets a value indicating how to position the button's caption relative to image.

Parameters
value

CaptionImageRelation

Returns

void


downCaption

Get Signature

get downCaption(): string | null

Gets or sets the button's caption used when the mouse button is pressed within its active area.

Returns

string | null

Set Signature

set downCaption(value): void

Gets or sets the button's caption used when the mouse button is pressed within its active area.

Parameters
value

string | null

Returns

void


id

Get Signature

get id(): number

Gets the reference to the object.

Returns

number

Inherited from

ObjectBase.id


image

Get Signature

get image(): PdfImageHandler | null

Gets the button's image as PdfImageHandler object.

You can use PdfImageHandler#image property to get actual image.

Returns

PdfImageHandler | null

Set Signature

set image(value): void

Sets the button's image.

You can use PdfImageHandler to assign an image to this property, for example:

Example
const img = await Image.load(IMAGE_BYTES);
btn.buttonAppearance.image = doc.imageHandlers.GetImageHandler(img);
Parameters
value

PdfImageHandler | null

Returns

void


imageScale

Get Signature

get imageScale(): ImageScaleProperties

Gets or sets the ImageScaleProperties object defining attributes of image scaling.

Returns

ImageScaleProperties

Set Signature

set imageScale(value): void

Gets or sets the ImageScaleProperties object defining attributes of image scaling.

Parameters
value

ImageScaleProperties

Returns

void


om

Get Signature

get om(): ObjectManager

Gets the owner ObjectManager instance.

Returns

ObjectManager

Inherited from

ObjectBase.om


rolloverCaption

Get Signature

get rolloverCaption(): string | null

Gets the button's caption used when the user rolls the cursor into its active area without pressing the mouse button.

Returns

string | null

Set Signature

set rolloverCaption(value): void

Sets the button's caption used when the user rolls the cursor into its active area without pressing the mouse button.

Parameters
value

string | null

Returns

void

Methods

free()

free(): void

Detaches the object from the ObjectManager and deallocates its memory, if possible.

Returns

void

Inherited from

ObjectBase.free


rebind()

rebind(omTo): void

Rebinds the object from the current ObjectManager to the specified one.

Parameters

omTo

ObjectManager

The new ObjectManager for the object.

Returns

void

Inherited from

ObjectBase.rebind