# DefaultAppearance

## Content

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

***

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

# Class: DefaultAppearance

Represents the default appearance of an annotation.

## Extends

- [`ObjectBase`](ObjectBase)

## Accessors

### font

#### Get Signature

> **get** **font**(): [`Font`](Font) \| `null`

Gets or sets the [Font](Font) object.

In a newly created document the value of this property is null.
If the value has not been set when the document is saved
(and for fields, the owner field has been added to [PdfDocument](PdfDocument)),
a default value is automatically assigned depending on the type
of the current object's owner:

1. [TextField](TextField), [ComboBoxField](ComboBoxField), [CombTextField](CombTextField), [ListBoxField](ListBoxField), [PushButtonField](PushButtonField)
   The default font is Helvetica, 9pt, Black.
2. [CheckBoxField](CheckBoxField), [RadioButtonField](RadioButtonField)
   The default font is ZapfDingbats, 0 (meaning auto-size), Black.
   (Note that for these field types ZapfDingbats will always be used regardless of the current setting.)
3. [RedactAnnotation](RedactAnnotation), [FreeTextAnnotation](FreeTextAnnotation)
   The default font is Helvetica, 9pt, Black.

When setting this property, you may use [FontCollection#searchFont](FontCollection#searchfont)
or other [FontCollection](FontCollection) methods to find a suitable font.

##### Returns

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

#### Set Signature

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

Gets or sets the [Font](Font) object.

In a newly created document the value of this property is null.
If the value has not been set when the document is saved
(and for fields, the owner field has been added to [PdfDocument](PdfDocument)),
a default value is automatically assigned depending on the type
of the current object's owner:

1. [TextField](TextField), [ComboBoxField](ComboBoxField), [CombTextField](CombTextField), [ListBoxField](ListBoxField), [PushButtonField](PushButtonField)
   The default font is Helvetica, 9pt, Black.
2. [CheckBoxField](CheckBoxField), [RadioButtonField](RadioButtonField)
   The default font is ZapfDingbats, 0 (meaning auto-size), Black.
   (Note that for these field types ZapfDingbats will always be used regardless of the current setting.)
3. [RedactAnnotation](RedactAnnotation), [FreeTextAnnotation](FreeTextAnnotation)
   The default font is Helvetica, 9pt, Black.

When setting this property, you may use [FontCollection#searchFont](FontCollection#searchfont)
or other [FontCollection](FontCollection) methods to find a suitable font.

##### Parameters

###### value

[`Font`](Font) | `null`

##### Returns

`void`

***

### fontSize

#### Get Signature

> **get** **fontSize**(): `number` \| `null`

Gets or sets the font size in points.

In a newly created document the value of this property is null.
If the value has not been set when the document is saved
(and for fields, the owner field has been added to [PdfDocument](PdfDocument)),
a default value is automatically assigned depending on the type
of the current object's owner:

1. [TextField](TextField), [ComboBoxField](ComboBoxField), [CombTextField](CombTextField), [ListBoxField](ListBoxField), [PushButtonField](PushButtonField)
   The default font is Helvetica, 9pt, Black.
2. [CheckBoxField](CheckBoxField), [RadioButtonField](RadioButtonField)
   The default font is ZapfDingbats, 0 (meaning auto-size), Black.
   (Note that for these field types ZapfDingbats will always be used regardless of the current setting.)
3. [RedactAnnotation](RedactAnnotation), [FreeTextAnnotation](FreeTextAnnotation)
   The default font is Helvetica, 9pt, Black.

##### Returns

`number` \| `null`

#### Set Signature

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

Gets or sets the font size in points.

In a newly created document the value of this property is null.
If the value has not been set when the document is saved
(and for fields, the owner field has been added to [PdfDocument](PdfDocument)),
a default value is automatically assigned depending on the type
of the current object's owner:

1. [TextField](TextField), [ComboBoxField](ComboBoxField), [CombTextField](CombTextField), [ListBoxField](ListBoxField), [PushButtonField](PushButtonField)
   The default font is Helvetica, 9pt, Black.
2. [CheckBoxField](CheckBoxField), [RadioButtonField](RadioButtonField)
   The default font is ZapfDingbats, 0 (meaning auto-size), Black.
   (Note that for these field types ZapfDingbats will always be used regardless of the current setting.)
3. [RedactAnnotation](RedactAnnotation), [FreeTextAnnotation](FreeTextAnnotation)
   The default font is Helvetica, 9pt, Black.

##### Parameters

###### value

`number` | `null`

##### Returns

`void`

***

### foreColor

#### Get Signature

> **get** **foreColor**(): [`Color`](../type-aliases/Color) \| `null`

Gets or sets the foreground color.

In a newly created document the value of this property is null.
If the value has not been set when the document is saved
(and for fields, the owner field has been added to [PdfDocument](PdfDocument)),
a default value is automatically assigned depending on the type
of the current object's owner:

1. [TextField](TextField), [ComboBoxField](ComboBoxField), [CombTextField](CombTextField), [ListBoxField](ListBoxField), [PushButtonField](PushButtonField)
   The default font is Helvetica, 9pt, Black.
2. [CheckBoxField](CheckBoxField), [RadioButtonField](RadioButtonField)
   The default font is ZapfDingbats, 0 (meaning auto-size), Black.
   (Note that for these field types ZapfDingbats will always be used regardless of the current setting.)
3. [RedactAnnotation](RedactAnnotation), [FreeTextAnnotation](FreeTextAnnotation)
   The default font is Helvetica, 9pt, Black.

##### Returns

[`Color`](../type-aliases/Color) \| `null`

#### Set Signature

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

Gets or sets the foreground color.

In a newly created document the value of this property is null.
If the value has not been set when the document is saved
(and for fields, the owner field has been added to [PdfDocument](PdfDocument)),
a default value is automatically assigned depending on the type
of the current object's owner:

1. [TextField](TextField), [ComboBoxField](ComboBoxField), [CombTextField](CombTextField), [ListBoxField](ListBoxField), [PushButtonField](PushButtonField)
   The default font is Helvetica, 9pt, Black.
2. [CheckBoxField](CheckBoxField), [RadioButtonField](RadioButtonField)
   The default font is ZapfDingbats, 0 (meaning auto-size), Black.
   (Note that for these field types ZapfDingbats will always be used regardless of the current setting.)
3. [RedactAnnotation](RedactAnnotation), [FreeTextAnnotation](FreeTextAnnotation)
   The default font is Helvetica, 9pt, Black.

##### Parameters

###### value

[`Color`](../type-aliases/Color) | `null`

##### Returns

`void`

***

### id

#### Get Signature

> **get** **id**(): `number`

Gets the reference to the object.

##### Returns

`number`

#### Inherited from

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

***

### om

#### Get Signature

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

Gets the owner [ObjectManager](ObjectManager) instance.

##### Returns

[`ObjectManager`](ObjectManager)

#### Inherited from

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

***

### text

#### Get Signature

> **get** **text**(): `string` \| `null`

Gets or sets the text representing the appearance as it will be stored in a PDF stream
(e.g. "/DF0 10 Tf 0 0 0 rg").

Please see the PDF specification for details.

##### Returns

`string` \| `null`

#### Set Signature

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

Gets or sets the text representing the appearance as it will be stored in a PDF stream
(e.g. "/DF0 10 Tf 0 0 0 rg").

Please see the PDF specification for details.

##### 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)
