# DestinationFit

## Content

# Class: DestinationFit

Display the page designated by [Destination#page](Destination#page), with its contents magnified just enough to fit the entire page
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 page within the window in the other dimension.

## Extends

- [`Destination`](Destination)

## Constructors

### Constructor

```ts
new DestinationFit(om, pageIndex): DestinationFit;
```

Initializes a new instance of the DestinationFit class.

#### Parameters

##### om

[`ObjectManager`](ObjectManager)

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

##### pageIndex

`number`

The target page index.

#### Returns

`DestinationFit`

#### Overrides

```ts
Destination.constructor
```

### Constructor

```ts
new DestinationFit(pageIndex): DestinationFit;
```

Initializes a new instance of the DestinationFit class.

#### Parameters

##### pageIndex

`number`

The target page index.

#### Returns

`DestinationFit`

#### Overrides

```ts
Destination.constructor
```

### Constructor

```ts
new DestinationFit(om, page): DestinationFit;
```

Initializes a new instance of the DestinationFit class.

#### Parameters

##### om

[`ObjectManager`](ObjectManager)

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

##### page

[`PdfPage`](PdfPage)

The target [PdfPage](PdfPage).

#### Returns

`DestinationFit`

#### Overrides

```ts
Destination.constructor
```

### Constructor

```ts
new DestinationFit(page): DestinationFit;
```

Initializes a new instance of the DestinationFit class.

#### Parameters

##### page

[`PdfPage`](PdfPage)

The target [PdfPage](PdfPage).

#### Returns

`DestinationFit`

#### Overrides

```ts
Destination.constructor
```

### Constructor

```ts
new DestinationFit(om, structElement): DestinationFit;
```

Initializes a new instance of the DestinationFit class.

#### Parameters

##### om

[`ObjectManager`](ObjectManager)

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

##### structElement

[`StructElement`](StructElement)

The [StructElement](StructElement) used to obtain the target page.

#### Returns

`DestinationFit`

#### Overrides

```ts
Destination.constructor
```

### Constructor

```ts
new DestinationFit(structElement): DestinationFit;
```

Initializes a new instance of the DestinationFit class.

#### Parameters

##### structElement

[`StructElement`](StructElement)

The [StructElement](StructElement) used to obtain the target page.

#### Returns

`DestinationFit`

#### Overrides

```ts
Destination.constructor
```

## Accessors

### id

#### Get Signature

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

Gets the reference to the object.

##### Returns

`number`

#### Inherited from

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

***

### om

#### Get Signature

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

Gets the owner [ObjectManager](ObjectManager) instance.

##### Returns

[`ObjectManager`](ObjectManager)

#### Inherited from

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

***

### page

#### Get Signature

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

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

##### Returns

[`PdfPage`](PdfPage)

#### Inherited from

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

***

### pageIndex

#### Get Signature

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

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`

#### Inherited from

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

## Methods

### free()

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

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

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