Show / Hide Table of Contents

# Class Destination

A destination defines a particular view of a document, consisting of the following:

- 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

Destinations may be associated with Bookmarks, Annotations, and Remote Go-To Actions.

Destination is a utility class used to simplify work with PDF Destinations; Please refer to section 8.2.1 'Destinations' in PDF Reference Manual for details.

##### Inheritance

object
Destination

##### Implements

IDisposable

##### Inherited Members

object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()

###### Namespace: pdftron.PDF

###### Assembly: PDFTronDotNet.dll

##### Syntax

    public class Destination : IDisposable

### Constructors

#### Destination(Obj)

Instantiates `Destination` from given `SDF::Obj` object

##### Declaration

    public Destination(Obj dest)

##### Parameters

Type | Name | Description
--- | --- | ---
Obj | dest | `SDF::Obj` destination object

### Methods

#### CreateFit(Page)

Create a new 'Fit' Destination.

The new Destination displays the page designated by '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.

##### Declaration

    public static Destination CreateFit(Page page)

##### Parameters

Type | Name | Description
--- | --- | ---
Page | page | the page

##### Returns

Type | Description
--- | ---
Destination | the destination

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### CreateFitB(Page)

Create a new 'FitB' Destination.

The new Destination displays the page designated by 'page', with its contents magnified just enough to fit its bounding box 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 bounding box within the window in the other dimension.

##### Declaration

    public static Destination CreateFitB(Page page)

##### Parameters

Type | Name | Description
--- | --- | ---
Page | page | the page

##### Returns

Type | Description
--- | ---
Destination | the destination

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### CreateFitBH(Page, double)

Create a new 'FitBH' Destination.

The new Destination displays the page designated by 'page', with the vertical coordinate 'top' positioned at the top edge of the window and the contents of the page magnified just enough to fit the entire width of its bounding box within the window.

##### Declaration

    public static Destination CreateFitBH(Page page, double top)

##### Parameters

Type | Name | Description
--- | --- | ---
Page | page | the page
double | top | the top

##### Returns

Type | Description
--- | ---
Destination | the destination

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### CreateFitBV(Page, double)

Create a new 'FitBV' Destination.

The new Destination displays Display the page designated by 'page', with the horizontal coordinate 'left' positioned at the left edge of the window and the contents of the page magnified just enough to fit the entire height of its bounding box within the window.

##### Declaration

    public static Destination CreateFitBV(Page page, double left)

##### Parameters

Type | Name | Description
--- | --- | ---
Page | page | the page
double | left | the left

##### Returns

Type | Description
--- | ---
Destination | the destination

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### CreateFitH(Page, double)

Create a new 'FitH' Destination.

The new Destination displays the page designated by 'page', with the vertical coordinate 'top' positioned at the top edge of the window and the contents of the page magnified just enough to fit the entire width of the page within the window.

##### Declaration

    public static Destination CreateFitH(Page page, double top)

##### Parameters

Type | Name | Description
--- | --- | ---
Page | page | the page
double | top | the top

##### Returns

Type | Description
--- | ---
Destination | the destination

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### CreateFitR(Page, double, double, double, double)

Create a new 'FitR' Destination.

The new Destination displays the page designated by '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.

##### Declaration

    public static Destination CreateFitR(Page page, double left, double bottom, double right, double top)

##### Parameters

Type | Name | Description
--- | --- | ---
Page | page | the page
double | left | the left
double | bottom | the bottom
double | right | the right
double | top | the top

##### Returns

Type | Description
--- | ---
Destination | the destination

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### CreateFitV(Page, double)

Create a new 'FitV' Destination.

The new Destination displays the page designated by 'page', with the horizontal coordinate 'left' positioned at the left edge of the window and the contents of the page magnified just enough to fit the entire height of the page within the window.

##### Declaration

    public static Destination CreateFitV(Page page, double left)

##### Parameters

Type | Name | Description
--- | --- | ---
Page | page | the page
double | left | the left

##### Returns

Type | Description
--- | ---
Destination | the destination

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### CreateXYZ(Page, double, double, double)

Create a new 'XYZ' Destination.

The new Destination displays the page designated by 'page', with the coordinates ('left', 'top') positioned at the top-left corner of the window and the contents of the page magnified by the factor 'zoom'. A null value for any of the parameters 'left', 'top', or 'zoom' specifies that the current value of that parameter is to be retained unchanged. A 'zoom' value of 0 has the same meaning as a null value.

##### Declaration

    public static Destination CreateXYZ(Page page, double left, double top, double zoom)

##### Parameters

Type | Name | Description
--- | --- | ---
Page | page | the page
double | left | the left
double | top | the top
double | zoom | the zoom

##### Returns

Type | Description
--- | ---
Destination | the destination

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

##### Declaration

    public void Dispose()

#### Dispose(bool)

##### Declaration

    protected virtual void Dispose(bool disposing)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | disposing |

#### ~Destination()

Releases all resources used by the Destination

##### Declaration

    protected ~Destination()

#### GetExplicitDestObj()

Gets the explicit dest obj.

##### Declaration

    public Obj GetExplicitDestObj()

##### Returns

Type | Description
--- | ---
Obj | the explicit destination SDF/Cos object. This is always an Array as shown in Table 8.2 in PDF Reference Manual.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetFitType()

Gets the fit type.

##### Declaration

    public Destination.FitType GetFitType()

##### Returns

Type | Description
--- | ---
Destination.FitType | destination's FitType.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetPage()

Gets the page.

##### Declaration

    public Page GetPage()

##### Returns

Type | Description
--- | ---
Page | the Page that this destination refers to.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### GetSDFObj()

Gets the SDFObj.

##### Declaration

    public Obj GetSDFObj()

##### Returns

Type | Description
--- | ---
Obj | the object to the underlying SDF/Cos object. The returned SDF/Cos object is an explicit destination (i.e. the Obj is either an array defining the destination, using the syntax shown in Table 8.2 in PDF Reference Manual), or a dictionary with a 'D' entry whose value is such an array. The latter form allows additional attributes to be associated with the destination

#### IsValid()

Checks if is valid.

##### Declaration

    public bool IsValid()

##### Returns

Type | Description
--- | ---
bool | True if this is a valid Destination and can be resolved, false otherwise.

##### Remarks

If this method returns false the underlying SDF/Cos object is null and the Action object should be treated as null as well.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### Set(Destination)

Sets value to given `Destination` object

##### Declaration

    public void Set(Destination p)

##### Parameters

Type | Name | Description
--- | --- | ---
Destination | p | given `Destination` object

#### SetPage(Page)

Modify the destination so that it refers to the new 'page' as the destination page.

##### Declaration

    public void SetPage(Page page)

##### Parameters

Type | Name | Description
--- | --- | ---
Page | page | The new page associated with this Destination.

##### Exceptions

Type | Condition
--- | ---
PDFNetException | PDFNetException the PDFNet exception

#### op_Assign(Destination)

Assignment operator

##### Declaration

    public Destination op_Assign(Destination r)

##### Parameters

Type | Name | Description
--- | --- | ---
Destination | r | `Destination` object at the right of the operator

##### Returns

Type | Description
--- | ---
Destination | `Destination` object equals to the specified object

### Implements

IDisposable