# ViewDestination Class

> Represents a particular view of a page in a document.

- Product: Adobe PDF Library 18
- Language: Java
- Version: APDFL18.0.5PlusP2e
- HTML page: https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/ViewDestination
- Version index: https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/llms.txt

```java
class ViewDestination
```

**Namespace:** `com::datalogics::PDFL`

## Description

Represents a particular view of a page in a document. A destination describes a place in the PDF document where the user will be taken in response to clicking a hyperlink. The destination defines where a bookmark or hyperlink points to.

The ViewDestination contains a reference to a page, a place (rectangle) on that page, and information specifying how to adjust the view to fit the window's size and shape.

**Referenced by:** [`Bookmark`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Bookmark.md), [`GoToAction`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/GoToAction.md), [`LinkAnnotation`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/LinkAnnotation.md), [`ViewDestination`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/ViewDestination.md)

**Uses types:** [`Document`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Document.md), [`PDFArray`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/PDFArray.md), [`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Rect.md), [`ViewDestination`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/ViewDestination.md)

## Constructors

### ViewDestination

```java
com.datalogics.PDFL.ViewDestination.ViewDestination(Document doc, int pageNum, String fitType, Rect r, double zoom)
```

*constructor*

**Parameters**

- `doc` ([`Document`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Document.md)): Containing document
- `pageNum` (`int`): Target page number
- `fitType` (`String`): Fit Type must be: "XYZ", "Fit", "FitH", "FitV", "FitR", "FitB", "FitBH", or "FitBV".
- `r` ([`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Rect.md)): Target rectangle
- `zoom` (`double`): Zoom level

General purpose constructor: construct with all elements

## Fields

### CViewDestination_NullValue

```java
static final double com.datalogics.PDFL.ViewDestination.CViewDestination_NullValue
```

*static*

Constant used for "null" values in destination rectangles or zoom.

### NULL_VALUE

```java
static final double com.datalogics.PDFL.ViewDestination.NULL_VALUE
```

*static*

### NullValue

```java
static final double com.datalogics.PDFL.ViewDestination.NullValue
```

*static*

## Methods

### delete

```java
synchronized void com.datalogics.PDFL.ViewDestination.delete(Boolean disposing)
```

*protected*

**Parameters**

- `disposing` (`Boolean`)

**Returns:** `synchronized void`

### delete

```java
synchronized void com.datalogics.PDFL.ViewDestination.delete()
```

**Returns:** `synchronized void`

### equals

```java
boolean com.datalogics.PDFL.ViewDestination.equals(Object rhs)
```

**Parameters**

- `rhs` (`Object`)

**Returns:** `boolean`

### finalize

```java
void com.datalogics.PDFL.ViewDestination.finalize()
```

*protected*

**Returns:** `void`

### getDestRect

```java
Rect com.datalogics.PDFL.ViewDestination.getDestRect()
```

**Returns:** [`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Rect.md)

The destination rectangle for this view.

The destination rectangle. Coordinates with a value of NullValue indicate that the corresponding coordinate is not specified in the destination.

### getFitType

```java
String com.datalogics.PDFL.ViewDestination.getFitType()
```

**Returns:** `String`

The fit type string for this destination.

The fit type describing how the destination page is displayed. The fit type determines how the page content is fitted into the window. Valid fit types are: "XYZ", "Fit", "FitH", "FitV", "FitR", "FitB", "FitBH", and "FitBV".

### getPDFArray

```java
PDFArray com.datalogics.PDFL.ViewDestination.getPDFArray()
```

**Returns:** [`PDFArray`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/PDFArray.md)

The underlying PDF array object for this destination.

Retrieve the PDFArray representation of this ViewDestination.

### getPageNumber

```java
int com.datalogics.PDFL.ViewDestination.getPageNumber()
```

**Returns:** `int`

The zero-based page number for this destination.

The page number of the destination.

### getZoom

```java
double com.datalogics.PDFL.ViewDestination.getZoom()
```

**Returns:** `double`

The zoom factor, or NullValue if not set.

The zoom factor for the destination. A value of NullValue indicates that the zoom factor is not specified.

### setDestRect

```java
void com.datalogics.PDFL.ViewDestination.setDestRect(Rect ViewDestRect)
```

**Parameters**

- `ViewDestRect` ([`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Rect.md)): The rectangle defining the visible area of the destination page.

**Returns:** `void`

Set the destination rectangle of the view.

### setFitType

```java
void com.datalogics.PDFL.ViewDestination.setFitType(String ViewDestFitType)
```

**Parameters**

- `ViewDestFitType` (`String`): The fit type string. Must be one of: "XYZ", "Fit", "FitH", "FitV", "FitR", "FitB", "FitBH", or "FitBV".

**Returns:** `void`

Set the fit type for the view.

### setPageNumber

```java
void com.datalogics.PDFL.ViewDestination.setPageNumber(int ViewDestPageNum)
```

**Parameters**

- `ViewDestPageNum` (`int`): The zero-based page number to set as the destination.

**Returns:** `void`

Set the page number of the destination starting at 0.

### setZoom

```java
void com.datalogics.PDFL.ViewDestination.setZoom(double ViewDestZoomFactor)
```

**Parameters**

- `ViewDestZoomFactor` (`double`): The zoom level to apply when navigating to this destination.

**Returns:** `void`

Set the zoom factor for the destination.

### toString

```java
String com.datalogics.PDFL.ViewDestination.toString()
```

**Returns:** `String`

A formatted string describing this ViewDestination.

Return a string representation of the ViewDestination. The string includes the page number, fit type, destination rectangle, and zoom factor.
