# RichMediaAnnotation

## Content

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

***

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

# Class: RichMediaAnnotation

Represents a rich media annotation.
Rich media annotations provide a common framework for video, audio,
animations and other multimedia presentations.

## Extends

- [`AnnotationBase`](AnnotationBase)

## Constructors

### Constructor

> **new RichMediaAnnotation**(`om`): `RichMediaAnnotation`

Creates a new RichMediaAnnotation.

#### Parameters

##### om

[`ObjectManager`](ObjectManager)

[ObjectManager](ObjectManager) that controls the lifetime of the RichMediaAnnotation.

#### Returns

`RichMediaAnnotation`

#### Overrides

`AnnotationBase.constructor`

### Constructor

> **new RichMediaAnnotation**(): `RichMediaAnnotation`

Creates a new RichMediaAnnotation.

#### Returns

`RichMediaAnnotation`

#### Overrides

`AnnotationBase.constructor`

## Accessors

### activationCondition

#### Get Signature

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

Gets or sets the string specifying
the circumstances under which the annotation shall be activated, the valid values:
"XA" - The annotation is explicitly activated by a user action or script.
"PO" - The annotation is activated as soon as the page that
       contains the annotation receives focus as the current page.
"PV" - The annotation is activated as soon as any part of the page that
       contains the annotation becomes visible.

##### Returns

`string` \| `null`

#### Set Signature

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

Gets or sets the string specifying
the circumstances under which the annotation shall be activated, the valid values:
"XA" - The annotation is explicitly activated by a user action or script.
"PO" - The annotation is activated as soon as the page that
       contains the annotation receives focus as the current page.
"PV" - The annotation is activated as soon as any part of the page that
       contains the annotation becomes visible.

##### Parameters

###### value

`string` | `null`

##### Returns

`void`

***

### contents

#### Get Signature

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

Gets or sets the text to be displayed for the annotation or,
if this type of annotation does not display text,
an alternate description of the annotation's contents in human-readable form.
In either case, this text is useful when extracting the document's contents in support of accessibility
to users with disabilities or for other purposes.

##### Returns

`string` \| `null`

#### Set Signature

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

Gets or sets the text to be displayed for the annotation or,
if this type of annotation does not display text,
an alternate description of the annotation's contents in human-readable form.
In either case, this text is useful when extracting the document's contents in support of accessibility
to users with disabilities or for other purposes.

##### Parameters

###### value

`string` | `null`

##### Returns

`void`

#### Inherited from

[`AnnotationBase`](AnnotationBase).[`contents`](AnnotationBase#contents)

***

### deactivationCondition

#### Get Signature

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

Gets or sets the string specifying
the circumstances under which the annotation shall be deactivated, the valid values:
"XD" - The annotation is explicitly deactivated by a user action or script.
"PC" - The annotation is deactivated as soon as the page that contains
       the annotation loses focus as the current page.
"PI" - The annotation is deactivated as soon as the entire page
       that contains the annotation is no longer visible.

##### Returns

`string` \| `null`

#### Set Signature

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

Gets or sets the string specifying
the circumstances under which the annotation shall be deactivated, the valid values:
"XD" - The annotation is explicitly deactivated by a user action or script.
"PC" - The annotation is deactivated as soon as the page that contains
       the annotation loses focus as the current page.
"PI" - The annotation is deactivated as soon as the entire page
       that contains the annotation is no longer visible.

##### Parameters

###### value

`string` | `null`

##### Returns

`void`

***

### doc

#### Get Signature

> **get** **doc**(): [`PdfDocument`](PdfDocument) \| `null`

Gets the [PdfDocument](PdfDocument) owning this annotation.

##### Returns

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

#### Inherited from

[`AnnotationBase`](AnnotationBase).[`doc`](AnnotationBase#doc)

***

### flags

#### Get Signature

> **get** **flags**(): [`AnnotationFlags`](../enumerations/AnnotationFlags)

Gets or sets the flags specifying various characteristics of the annotation.

##### Returns

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

#### Set Signature

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

Gets or sets the flags specifying various characteristics of the annotation.

##### Parameters

###### value

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

##### Returns

`void`

#### Inherited from

[`AnnotationBase`](AnnotationBase).[`flags`](AnnotationBase#flags)

***

### id

#### Get Signature

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

Gets the reference to the object.

##### Returns

`number`

#### Inherited from

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

***

### locked

#### Get Signature

> **get** **locked**(): `boolean`

Gets or sets a value indicating whether the annotation can be deleted or its properties (including position and size) can be modified by the user.
However, this flag does not restrict changes to the annotation's contents, such as the value of a form field.

##### Returns

`boolean`

#### Set Signature

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

Gets or sets a value indicating whether the annotation can be deleted or its properties (including position and size) can be modified by the user.
However, this flag does not restrict changes to the annotation's contents, such as the value of a form field.

##### Parameters

###### value

`boolean`

##### Returns

`void`

#### Inherited from

[`AnnotationBase`](AnnotationBase).[`locked`](AnnotationBase#locked)

***

### lockedContents

#### Get Signature

> **get** **lockedContents**(): `boolean`

Gets or sets a value indicating whether the contents of the annotation can be modified by the user.
This flag does not restrict deletion of the annotation or changes to other annotation properties,
such as position and size.

##### Returns

`boolean`

#### Set Signature

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

Gets or sets a value indicating whether the contents of the annotation can be modified by the user.
This flag does not restrict deletion of the annotation or changes to other annotation properties,
such as position and size.

##### Parameters

###### value

`boolean`

##### Returns

`void`

#### Inherited from

[`AnnotationBase`](AnnotationBase).[`lockedContents`](AnnotationBase#lockedcontents)

***

### modifiedDate

#### Get Signature

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

Gets or sets the date and time when the annotation was modified.

##### Returns

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

#### Set Signature

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

Gets or sets the date and time when the annotation was modified.

##### Parameters

###### value

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

##### Returns

`void`

#### Inherited from

[`AnnotationBase`](AnnotationBase).[`modifiedDate`](AnnotationBase#modifieddate)

***

### name

#### Get Signature

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

Gets or sets the annotation name, a text string uniquely identifying it among all annotations on its page.

##### Returns

`string` \| `null`

#### Set Signature

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

Gets or sets the annotation name, a text string uniquely identifying it among all annotations on its page.

##### Parameters

###### value

`string` | `null`

##### Returns

`void`

#### Inherited from

[`AnnotationBase`](AnnotationBase).[`name`](AnnotationBase#name)

***

### om

#### Get Signature

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

Gets the owner [ObjectManager](ObjectManager) instance.

##### Returns

[`ObjectManager`](ObjectManager)

#### Inherited from

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

***

### page

#### Get Signature

> **get** **page**(): [`PdfPage`](PdfPage) \| `null`

Gets or sets the [PdfPage](PdfPage) that contains this annotation.
Note that an annotation may be referenced by several pages.
In that case this property returns the first element in the 
[pages](AnnotationBase#pages) collection.
When setting this property, the following applies:
If the new value is null, this annotation is removed from all pages.
Otherwise, this annotation is assigned exclusively to the specified page.

##### Returns

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

#### Set Signature

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

Gets or sets the [PdfPage](PdfPage) that contains this annotation.
Note that an annotation may be referenced by several pages.
In that case this property returns the first element in the 
[pages](AnnotationBase#pages) collection.
When setting this property, the following applies:
If the new value is null, this annotation is removed from all pages.
Otherwise, this annotation is assigned exclusively to the specified page.

##### Parameters

###### value

[`PdfPage`](PdfPage) | `null`

##### Returns

`void`

#### Inherited from

[`UnknownAnnotation`](UnknownAnnotation).[`page`](UnknownAnnotation#page)

***

### pages

#### Get Signature

> **get** **pages**(): [`AnnotationPagesCollection`](AnnotationPagesCollection)

Gets the list of pages that reference this annotation.

##### Returns

[`AnnotationPagesCollection`](AnnotationPagesCollection)

#### Inherited from

[`AnnotationBase`](AnnotationBase).[`pages`](AnnotationBase#pages)

***

### pdfRect

#### Get Signature

> **get** **pdfRect**(): [`Rect`](../type-aliases/Rect)

Gets or sets the rectangle that defines the location and size of the annotation on a page
in PDF user space coordinates. 
The positive X axis extends horizontally to the right, and the positive Y axis
extends vertically upward, with the origin usually in the lower left corner of the page.

##### See

[rect](AnnotationBase#rect)

##### Returns

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

#### Set Signature

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

Gets or sets the rectangle that defines the location and size of the annotation on a page
in PDF user space coordinates. 
The positive X axis extends horizontally to the right, and the positive Y axis
extends vertically upward, with the origin usually in the lower left corner of the page.

##### See

[rect](AnnotationBase#rect)

##### Parameters

###### value

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

##### Returns

`void`

#### Inherited from

[`AnnotationBase`](AnnotationBase).[`pdfRect`](AnnotationBase#pdfrect)

***

### presentationStyle

#### Get Signature

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

Gets or sets the string specifying
the style of presentation of the rich media (embedded or windowed), the valid values:
"Embedded", "Windowed"

##### Returns

`string` \| `null`

#### Set Signature

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

Gets or sets the string specifying
the style of presentation of the rich media (embedded or windowed), the valid values:
"Embedded", "Windowed"

##### Parameters

###### value

`string` | `null`

##### Returns

`void`

***

### rect

#### Get Signature

> **get** **rect**(): [`Rect`](../type-aliases/Rect)

Gets or sets the rectangle that defines the location and size of the annotation on a page.
The coordinates of the rectangle are relative to the upper left corner of the page's
media box, with the Y (vertical) coordinates increasing from top to bottom.
Note that if the annotation is associated with more than one page,
the media box of the first of those pages is used to calculate the rectangle's location.

##### Returns

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

#### Set Signature

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

Gets or sets the rectangle that defines the location and size of the annotation on a page.
The coordinates of the rectangle are relative to the upper left corner of the page's
media box, with the Y (vertical) coordinates increasing from top to bottom.
Note that if the annotation is associated with more than one page,
the media box of the first of those pages is used to calculate the rectangle's location.

##### Parameters

###### value

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

##### Returns

`void`

#### Inherited from

[`UnknownAnnotation`](UnknownAnnotation).[`rect`](UnknownAnnotation#rect)

***

### showNavigationPane

#### Get Signature

> **get** **showNavigationPane**(): `boolean`

Gets or sets a value indicating the default behavior of a navigation pane user interface element.
If "true", the navigation pane should be visible when the content is initially activated.
If "false", the navigation pane should not be displayed.
The default is "false".

##### Returns

`boolean`

#### Set Signature

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

Gets or sets a value indicating the default behavior of a navigation pane user interface element.
If "true", the navigation pane should be visible when the content is initially activated.
If "false", the navigation pane should not be displayed.
The default is "false".

##### Parameters

###### value

`boolean`

##### Returns

`void`

***

### showToolbar

#### Get Signature

> **get** **showToolbar**(): `boolean`

Gets or sets the value indicating the default behavior of an interactive toolbar
associated with this annotation.
If "true", the toolbar should be displayed when the annotation is activated and given focus.
If "false", the toolbar should not be displayed.

##### Returns

`boolean`

#### Set Signature

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

Gets or sets the value indicating the default behavior of an interactive toolbar
associated with this annotation.
If "true", the toolbar should be displayed when the annotation is activated and given focus.
If "false", the toolbar should not be displayed.

##### Parameters

###### value

`boolean`

##### Returns

`void`

## Methods

### free()

> **free**(): `void`

Detaches the object from the [ObjectManager](ObjectManager) and deallocates its memory, if possible.

#### Returns

`void`

#### Inherited from

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

***

### getContent()

> **getContent**(): \{ `content`: [`FileSpecification`](FileSpecification); `type`: [`RichMediaAnnotationContentType`](../enumerations/RichMediaAnnotationContentType); \} \| `null`

Gets an object containing [FileSpecification](FileSpecification) object representing the content
associated with this RichMediaAnnotation and value specifying the type of content
audio or video.

#### Returns

\{ `content`: [`FileSpecification`](FileSpecification); `type`: [`RichMediaAnnotationContentType`](../enumerations/RichMediaAnnotationContentType); \} \| `null`

***

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

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

***

### removeAppearance()

> **removeAppearance**(): `void`

Removes all appearance streams associated with the current annotation,
and disables generation of appearance steams for this annotation when the document is saved.

Note that if any property affecting the annotation's appearance 'rect' is then changed,
the appearance streams will be regenerated. So this method would usually be called after
initializing all annotation's properties.

#### Returns

`void`

#### Inherited from

[`AnnotationBase`](AnnotationBase).[`removeAppearance`](AnnotationBase#removeappearance)

***

### resetAppearance()

> **resetAppearance**(): `void`

Forces regeneration of the annotation's appearance streams
next time the document is saved.

#### Returns

`void`

#### Inherited from

[`AnnotationBase`](AnnotationBase).[`resetAppearance`](AnnotationBase#resetappearance)

***

### setAudio()

> **setAudio**(`value`): `void`

Sets the content of this RichMediaAnnotation to the audio represented by a
[FileSpecification](FileSpecification) object.

#### Parameters

##### value

The [FileSpecification](FileSpecification) object representing the audio content.

[`FileSpecificationProperties`](../type-aliases/FileSpecificationProperties) | [`FileSpecification`](FileSpecification)

#### Returns

`void`

***

### setContent()

> **setContent**(`content`, `contentType`): `void`

Sets the content of this RichMediaAnnotation.

#### Parameters

##### content

The [FileSpecification](FileSpecification) object representing the content.

[`FileSpecificationProperties`](../type-aliases/FileSpecificationProperties) | [`FileSpecification`](FileSpecification)

##### contentType

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

The content type.

#### Returns

`void`

***

### setVideo()

> **setVideo**(`value`): `void`

Sets the content of this RichMediaAnnotation to the video represented by a
[FileSpecification](FileSpecification) object.

#### Parameters

##### value

The [FileSpecification](FileSpecification) object representing the video content.

[`FileSpecificationProperties`](../type-aliases/FileSpecificationProperties) | [`FileSpecification`](FileSpecification)

#### Returns

`void`
