# Destination

## Content

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

***

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

# Abstract Class: Destination

The abstract base class for types representing a destination 
that defines a particular view of a document.
A destination consists of:
  The page of the document to be displayed.
  The location of the document window on that page.
  The magnification (zoom factor) to use when displaying the page.

Important note about vertical coordinates:
In PDFs, all coordinates are specified relative to the bottom left corner,
with the Y axis going up. 
DsPdfJS uses the more common coordinate system with the origin
in the top left corner, with the Y axis going down.
In most situations the Y coordinates are automatically converted by DsPdfJS.
In classes derived from Destination this is also done if
the destination's target page is specified as the [PdfPage](PdfPage)
object.
But if the destination's target page is specified by index,
automatic conversion of the Y coordinate cannot be done, and it should be
specified relative to the bottom left corner as per the PDF spec.

When the Y coordinate is specified relative to the page bottom,
it is noted in the parameter's description.
(It is recommended that constructors accepting a [PdfPage](PdfPage) object
are used instead.)

All properties defining the Y coordinate has linked property with "Pdf" prefix,
for example Y and PdfY, the property with "Pdf" prefix contains a value relative to the
bottom left corner with the Y axis going up.

## Extends

- [`DestinationBase`](DestinationBase)

## Extended by

- [`DestinationXYZ`](DestinationXYZ)
- [`DestinationFit`](DestinationFit)
- [`DestinationFitH`](DestinationFitH)
- [`DestinationFitV`](DestinationFitV)
- [`DestinationFitR`](DestinationFitR)
- [`DestinationFitB`](DestinationFitB)
- [`DestinationFitBH`](DestinationFitBH)
- [`DestinationFitBV`](DestinationFitBV)
- [`DestinationUnknown`](DestinationUnknown)

## Accessors

### id

#### Get Signature

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

Gets the reference to the object.

##### Returns

`number`

#### Inherited from

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

***

### om

#### Get Signature

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

Gets the owner [ObjectManager](ObjectManager) instance.

##### Returns

[`ObjectManager`](ObjectManager)

#### Inherited from

[`DestinationBase`](DestinationBase).[`om`](DestinationBase#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`

***

### 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 description for details).

##### Returns

`number` \| `null`

## Methods

### free()

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

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

#### Returns

`void`

#### Inherited from

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

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