# DestinationFitR

## Content

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

***

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

# Class: DestinationFitR

Display the page designated by [Destination#page](Destination#page), with its contents magnified just enough to fit the rectangle
specified by the coordinates left, bottom, right, and top entirely within the window both horizontally and vertically.
If the required horizontal and vertical magnification factors are different, use the smaller of the two,
centering the rectangle within the window in the other dimension.

## Extends

- [`Destination`](Destination)

## Constructors

### Constructor

> **new DestinationFitR**(`om`, `pageIndex`, `bounds`): `DestinationFitR`

Initializes a new instance of the DestinationFitR class.

#### Parameters

##### om

[`ObjectManager`](ObjectManager)

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

##### pageIndex

`number`

The target page index.

##### bounds

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

The rectangle to fit relative to the bottom left corner.

#### Returns

`DestinationFitR`

#### Overrides

`Destination.constructor`

### Constructor

> **new DestinationFitR**(`pageIndex`, `bounds`): `DestinationFitR`

Initializes a new instance of the DestinationFitR class.

#### Parameters

##### pageIndex

`number`

The target page index.

##### bounds

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

The rectangle to fit relative to the bottom left corner.

#### Returns

`DestinationFitR`

#### Overrides

`Destination.constructor`

### Constructor

> **new DestinationFitR**(`om`, `page`, `bounds`): `DestinationFitR`

Initializes a new instance of the DestinationFitR class.

#### Parameters

##### om

[`ObjectManager`](ObjectManager)

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

##### page

[`PdfPage`](PdfPage)

The target [PdfPage](PdfPage).

##### bounds

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

The rectangle to fit relative to the top left corner.

#### Returns

`DestinationFitR`

#### Overrides

`Destination.constructor`

### Constructor

> **new DestinationFitR**(`page`, `bounds`): `DestinationFitR`

Initializes a new instance of the DestinationFitR class.

#### Parameters

##### page

[`PdfPage`](PdfPage)

The target [PdfPage](PdfPage).

##### bounds

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

The rectangle to fit relative to the top left corner.

#### Returns

`DestinationFitR`

#### Overrides

`Destination.constructor`

## Accessors

### bounds

#### Get Signature

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

Gets the rectangle to fit.

If the target page of this destination was specified as an index (see [Destination#pageIndex](Destination#pageindex)),
then this property returns a rectangle relative to the bottom left corner.
If the target page was specified as a page object (see [Destination#page](Destination#page)),
then this property returns a rectangle relative to the top left corner.
See [Destination](Destination) description for details.

##### Returns

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

***

### id

#### Get Signature

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

Gets the reference to the object.

##### Returns

`number`

#### Inherited from

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

***

### om

#### Get Signature

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

Gets the owner [ObjectManager](ObjectManager) instance.

##### Returns

[`ObjectManager`](ObjectManager)

#### Inherited from

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

***

### page

#### Get Signature

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

Gets this destination's target [PdfPage](PdfPage) object.
Returns null if the target page was specified by index.

##### Returns

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

#### Inherited from

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

***

### pageIndex

#### Get Signature

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

Gets the index of this destination's target page.
Returns null if the target page was specified as a [PdfPage](PdfPage) object.

Note that if this property is not null, then any Y coordinate is
relative to the bottom left corner (see [Destination](Destination) description for details).

##### Returns

`number` \| `null`

#### Inherited from

[`Destination`](Destination).[`pageIndex`](Destination#pageindex)

***

### pdfBounds

#### Get Signature

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

Gets the rectangle to fit relative to the bottom left corner.

##### Returns

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

## Methods

### free()

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

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

#### Returns

`void`

#### Inherited from

[`Destination`](Destination).[`free`](Destination#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

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