# Model3DAnnotation

## Content

# Class: Model3DAnnotation

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

```ts
new Model3DAnnotation(om): Model3DAnnotation;
```

Creates a new Model3DAnnotation.

#### Parameters

##### om

[`ObjectManager`](ObjectManager)

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

#### Returns

`Model3DAnnotation`

#### Overrides

```ts
AnnotationBase.constructor
```

### Constructor

```ts
new Model3DAnnotation(): Model3DAnnotation;
```

Creates a new Model3DAnnotation.

#### Returns

`Model3DAnnotation`

#### Overrides

```ts
AnnotationBase.constructor
```

## Accessors

### activationCondition

#### Get Signature

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

Gets the value specifying the circumstances under which the annotation shall be activated.
The [Model3DActivationCondition](../variables/Model3DActivationCondition) defines the values listed in the PDF specification;
this list may be extended in future revisions.

##### See

Model3DActivationCondition

##### Returns

`string`

#### Set Signature

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

Sets the value specifying the circumstances under which the annotation shall be activated.
The [Model3DActivationCondition](../variables/Model3DActivationCondition) defines the values listed in the PDF specification;
this list may be extended in future revisions.

##### See

Model3DActivationCondition

##### Parameters

###### value

`string`

##### Returns

`void`

***

### appearanceStreams

#### Get Signature

```ts
get appearanceStreams(): AppearanceStreams;
```

Gets the [AppearanceStreams](AppearanceStreams) object providing access to the annotation's appearance streams.

##### Returns

[`AppearanceStreams`](AppearanceStreams)

#### Inherited from

[`AnnotationBase`](AnnotationBase).[`appearanceStreams`](AnnotationBase#appearancestreams)

***

### associatedFiles

#### Get Signature

```ts
get associatedFiles(): AssociatedFiles;
```

Gets the list of embedded files associated with this annotation.

##### Returns

[`AssociatedFiles`](AssociatedFiles)

#### Inherited from

[`AnnotationBase`](AnnotationBase).[`associatedFiles`](AnnotationBase#associatedfiles)

***

### contents

#### Get Signature

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

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`

#### Set Signature

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

##### Returns

`void`

#### Inherited from

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

***

### deactivationCondition

#### Get Signature

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

Gets the value specifying the circumstances under which the annotation shall be deactivated.
The [Model3DDeactivationCondition](../variables/Model3DDeactivationCondition) defines the values listed in the PDF specification;
this list may be extended in future revisions.

##### See

Model3DDeactivationCondition

##### Returns

`string`

#### Set Signature

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

Sets the value specifying the circumstances under which the annotation shall be deactivated.
The [Model3DDeactivationCondition](../variables/Model3DDeactivationCondition) defines the values listed in the PDF specification;
this list may be extended in future revisions.

##### See

Model3DDeactivationCondition

##### Parameters

###### value

`string`

##### Returns

`void`

***

### defaultView

#### Get Signature

```ts
get defaultView(): Model3DView;
```

Gets the default initial [Model3DView](Model3DView) for this annotation.

The PDF specification allows the default view to be specified in multiple places and
using different forms (for example, by name or by index). This method encapsulates the
logic to find and return the effective default view that should be used when the
annotation is activated.

Typical resolution behavior:
- Inspect annotation-level settings that explicitly identify a default view.
- If not found, inspect the associated 3D stream(s) for a named or indexed default view.
- If the default is specified by name, the view with a matching [Model3DView.name](Model3DView#name)
  is returned;
- If specified by index, the view at that index in the stream's view list
  is returned.

If no explicit default view is defined or the referenced view cannot be resolved,
the method returns <c>null</c>.

##### Returns

[`Model3DView`](Model3DView)

#### Set Signature

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

Sets the default initial [Model3DView](Model3DView) for this annotation, the value can be specified
as object itself or zero-based index of 3D view in [Model3DStream.views](Model3DStream#views) collection.

##### Parameters

###### value

`number` \| [`Model3DView`](Model3DView)

##### Returns

`void`

***

### doc

#### Get Signature

```ts
get doc(): PdfDocument;
```

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

##### Returns

[`PdfDocument`](PdfDocument)

#### Inherited from

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

***

### flags

#### Get Signature

```ts
get flags(): AnnotationFlags;
```

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

##### Returns

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

#### Set Signature

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

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

Gets the reference to the object.

##### Returns

`number`

#### Inherited from

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

***

### locked

#### Get Signature

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

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

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

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

```ts
get modifiedDate(): PdfDateTime;
```

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

##### Returns

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

#### Set Signature

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

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

##### Parameters

###### value

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

##### Returns

`void`

#### Inherited from

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

***

### name

#### Get Signature

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

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

##### Returns

`string`

#### Set Signature

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

##### Returns

`void`

#### Inherited from

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

***

### om

#### Get Signature

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

Gets the owner [ObjectManager](ObjectManager) instance.

##### Returns

[`ObjectManager`](ObjectManager)

#### Inherited from

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

***

### page

#### Get Signature

```ts
get page(): PdfPage;
```

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)

#### Set Signature

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

##### Returns

`void`

#### Inherited from

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

***

### pages

#### Get Signature

```ts
get pages(): AnnotationPagesCollection;
```

Gets the list of pages that reference this annotation.

##### Returns

[`AnnotationPagesCollection`](AnnotationPagesCollection)

#### Inherited from

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

***

### pdfRect

#### Get Signature

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

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

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

Gets or sets the value specifyingthe style of presentation of the rich media (embedded or windowed).
The [Model3DPresentationStyle](../variables/Model3DPresentationStyle) defines the values listed in the PDF specification;
this list may be extended in future revisions.

##### See

Model3DPresentationStyle

##### Returns

`string`

#### Set Signature

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

Sets the value specifyingthe style of presentation of the rich media (embedded or windowed).
The [Model3DPresentationStyle](../variables/Model3DPresentationStyle) defines the values listed in the PDF specification;
this list may be extended in future revisions.

##### See

Model3DPresentationStyle

##### Parameters

###### value

`string`

##### Returns

`void`

***

### rect

#### Get Signature

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

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

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

***

### showToolbar

#### Get Signature

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

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

***

### stream

#### Get Signature

```ts
get stream(): Model3DStream;
```

Gets [Model3DStream](Model3DStream) object defining 3D content of the annotation.

##### Returns

[`Model3DStream`](Model3DStream)

#### Set Signature

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

Sets [Model3DStream](Model3DStream) object defining 3D content of the annotation.

##### Parameters

###### value

[`Model3DStream`](Model3DStream)

##### Returns

`void`

***

### transparent

#### Get Signature

```ts
get transparent(): boolean;
```

Gets the value indicating whether the interactive PDF processor shall display
the underlying page content through the transparent areas of the rich media content.

##### Returns

`boolean`

#### Set Signature

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

Sets the value indicating whether the interactive PDF processor shall display
the underlying page content through the transparent areas of the rich media content.

##### Parameters

###### value

`boolean`

##### Returns

`void`

## Methods

### createAppearanceContentStream()

```ts
createAppearanceContentStream(): FormXObject;
```

Creates an instance of [FormXObject](FormXObject) that can be used
to define the annotation's appearance stream.
Note that when this method is called, the annotation must already
have been added to the document, otherwise an exception will be thrown.

#### Returns

[`FormXObject`](FormXObject)

The [FormXObject](FormXObject) object.

#### Inherited from

[`AnnotationBase`](AnnotationBase).[`createAppearanceContentStream`](AnnotationBase#createappearancecontentstream)

***

### free()

```ts
free(): void;
```

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

#### Returns

`void`

#### Inherited from

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

***

### get3DContentBytes()

```ts
get3DContentBytes(): Uint8Array<ArrayBufferLike>;
```

Retrieves the 3D stream content from this annotation.

#### Returns

`Uint8Array`&lt;`ArrayBufferLike`&gt;

***

### get3DContentFormat()

```ts
get3DContentFormat(): string;
```

Retrieves the format of this annotation's 3D stream content.

#### Returns

`string`

***

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

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

***

### removeAppearance()

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

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

***

### set3DContent()

```ts
set3DContent(bytes, format): void;
```

Sets the 3D stream content for this annotation.
This method creates a new [Model3DStream](Model3DStream) with the provided stream data and format,
replacing any existing 3D stream in the annotation.

#### Parameters

##### bytes

`Uint8Array`

The 'Uint8Array' object containing the 3D model data in U3D or PRC formats.

##### format

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

The 3D model data format.

#### Returns

`void`

***

### setPreviewAppearance()

```ts
setPreviewAppearance(image): void;
```

Sets the preview appearance for this 3D annotation using a raster image.
This method creates a visual representation of the 3D content that is displayed when the 3D annotation
is not activated. Since DsPdf cannot automatically generate previews for 3D content, you must provide
a preview image generated by a third-party tool or rendered separately.
The provided image is stretched to fill the annotation's bounds ([AnnotationBase.rect](AnnotationBase#rect)).
The appearance stream is stored as the normal default appearance of the annotation.

#### Parameters

##### image

[`Image`](Image)

The [Image](Image) object to use as the preview appearance when the annotation is not activated.
The image will be stretched to fit the annotation's bounds.

#### Returns

`void`
