# ButtonAppearance

## Content

# 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

```ts
get caption(): string;
```

Gets or sets the button's caption.

##### Returns

`string`

#### Set Signature

```ts
set caption(value): void;
```

Gets or sets the button's caption.

##### Parameters

###### value

`string`

##### Returns

`void`

***

### captionImageRelation

#### Get Signature

```ts
get captionImageRelation(): CaptionImageRelation;
```

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

##### Returns

[`CaptionImageRelation`](../enumerations/CaptionImageRelation)

#### Set Signature

```ts
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

```ts
get downCaption(): string;
```

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

##### Returns

`string`

#### Set Signature

```ts
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`

##### Returns

`void`

***

### id

#### Get Signature

```ts
get id(): number;
```

Gets the reference to the object.

##### Returns

`number`

#### Inherited from

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

***

### image

#### Get Signature

```ts
get image(): PdfImageHandler;
```

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

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

##### Returns

[`PdfImageHandler`](PdfImageHandler)

#### Set Signature

```ts
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)

##### Returns

`void`

***

### imageScale

#### Get Signature

```ts
get imageScale(): ImageScaleProperties;
```

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

##### Returns

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

#### Set Signature

```ts
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

```ts
get om(): ObjectManager;
```

Gets the owner [ObjectManager](ObjectManager) instance.

##### Returns

[`ObjectManager`](ObjectManager)

#### Inherited from

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

***

### rolloverCaption

#### Get Signature

```ts
get rolloverCaption(): string;
```

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

##### Returns

`string`

#### Set Signature

```ts
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`

##### Returns

`void`

## Methods

### free()

```ts
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()

```ts
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)
