# ButtonAppearance

## Content

[**DsPdfJS API v9.1.3**](../README)

***

[DsPdfJS API](../globals) / ButtonAppearance

# Class: ButtonAppearance

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

## Extends

- [`ObjectBase`](ObjectBase)

## 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`](../enumerations/CaptionImageRelation)

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

##### Returns

[`CaptionImageRelation`](../enumerations/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`](../enumerations/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`](ObjectBase).[`id`](ObjectBase#id)

***

### image

#### Get Signature

> **get** **image**(): [`PdfImageHandler`](PdfImageHandler) \| `null`

Gets the button's image as [PdfImageHandler](PdfImageHandler) object.

You can use [PdfImageHandler#image](PdfImageHandler#image) property to get actual image.

##### Returns

[`PdfImageHandler`](PdfImageHandler) \| `null`

#### Set Signature

> **set** **image**(`value`): `void`

Sets the button's image.

You can use [PdfImageHandler](PdfImageHandler) to assign an image to this property, for example:

##### Example

```ts
const img = await Image.load(IMAGE_BYTES);
btn.buttonAppearance.image = doc.imageHandlers.GetImageHandler(img);
```

##### Parameters

###### value

[`PdfImageHandler`](PdfImageHandler) | `null`

##### Returns

`void`

***

### imageScale

#### Get Signature

> **get** **imageScale**(): [`ImageScaleProperties`](../type-aliases/ImageScaleProperties)

Gets or sets the [ImageScaleProperties](../type-aliases/ImageScaleProperties) object defining attributes of image scaling.

##### Returns

[`ImageScaleProperties`](../type-aliases/ImageScaleProperties)

#### Set Signature

> **set** **imageScale**(`value`): `void`

Gets or sets the [ImageScaleProperties](../type-aliases/ImageScaleProperties) object defining attributes of image scaling.

##### Parameters

###### value

[`ImageScaleProperties`](../type-aliases/ImageScaleProperties)

##### Returns

`void`

***

### om

#### Get Signature

> **get** **om**(): [`ObjectManager`](ObjectManager)

Gets the owner [ObjectManager](ObjectManager) instance.

##### Returns

[`ObjectManager`](ObjectManager)

#### Inherited from

[`ObjectBase`](ObjectBase).[`om`](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](ObjectManager) and deallocates its memory, if possible.

#### Returns

`void`

#### Inherited from

[`ObjectBase`](ObjectBase).[`free`](ObjectBase#free)

***

### rebind()

> **rebind**(`omTo`): `void`

Rebinds the object from the current [ObjectManager](ObjectManager) to the specified one.

#### Parameters

##### omTo

[`ObjectManager`](ObjectManager)

The new [ObjectManager](ObjectManager) for the object.

#### Returns

`void`

#### Inherited from

[`ObjectBase`](ObjectBase).[`rebind`](ObjectBase#rebind)
