public class

Destination

extends Object
java.lang.Object
   ↳ com.pdftron.pdf.Destination

Class Overview

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.

Summary

Constants
int e_Fit The Constant e_Fit.
int e_FitB The Constant e_FitB.
int e_FitBH The Constant e_FitBH.
int e_FitBV The Constant e_FitBV.
int e_FitH The Constant e_FitH.
int e_FitR The Constant e_FitR.
int e_FitV The Constant e_FitV.
int e_XYZ View Destination Fit Types: XYZ - Destination specified as upper-left corner point and a zoom factor.
Public Constructors
Destination(Obj dest)
Create a Destination and initialize it using given Cos/SDF object.
Public Methods
static Destination createFit(Page page)
Create a new 'Fit' Destination.
static Destination createFitB(Page page)
Create a new 'FitB' Destination.
static Destination createFitBH(Page page, double top)
Create a new 'FitBH' Destination.
static Destination createFitBV(Page page, double left)
Create a new 'FitBV' Destination.
static Destination createFitH(Page page, double top)
Create a new 'FitH' Destination.
static Destination createFitR(Page page, double left, double bottom, double right, double top)
Create a new 'FitR' Destination.
static Destination createFitV(Page page, double left)
Create a new 'FitV' Destination.
static Destination createXYZ(Page page, double left, double top, double zoom)
Create a new 'XYZ' Destination.
Obj getExplicitDestObj()
Get the explicit destination object.
int getFitType()
Get the Destination fit type.
Page getPage()
Get the destination page
Obj getSDFObj()
Get the SDFObj.
boolean isValid()
Checks if Destination is valid.
void setPage(Page page)
Modify the destination so that it refers to the new 'page' as the destination page.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int e_Fit

The Constant e_Fit.

Constant Value: 1 (0x00000001)

public static final int e_FitB

The Constant e_FitB.

Constant Value: 5 (0x00000005)

public static final int e_FitBH

The Constant e_FitBH.

Constant Value: 6 (0x00000006)

public static final int e_FitBV

The Constant e_FitBV.

Constant Value: 7 (0x00000007)

public static final int e_FitH

The Constant e_FitH.

Constant Value: 2 (0x00000002)

public static final int e_FitR

The Constant e_FitR.

Constant Value: 4 (0x00000004)

public static final int e_FitV

The Constant e_FitV.

Constant Value: 3 (0x00000003)

public static final int e_XYZ

View Destination Fit Types: XYZ - Destination specified as upper-left corner point and a zoom factor. Fit - Fits the page into the window FitH - Fits the widths of the page into the window FitV - Fits the height of the page into a window. FitR - Fits the rectangle specified by its upper-left and lower-right corner points into the window. FitB - Fits the rectangle containing all visible elements on the page into the window. FitBH - Fits the width of the bounding box into the window. FitBV - Fits the height of the bounding box into the window.

Constant Value: 0 (0x00000000)

Public Constructors

public Destination (Obj dest)

Create a Destination and initialize it using given Cos/SDF object.

Note: The constructor does not copy any data, but is instead the logical equivalent of a type cast.

Note: Named destinations (in case 'dest' is a Name or a String) are automatically resolved to the explicit destination. If the name can't be resolved to the explicit destination dest.IsValid() will return false.

Parameters
dest - a low-level (SDF/Cos) destination object. The low-level destination can be either a named destination (i.e. a Name or a String) or an explicit destination (i.e. an Array Obj). Please refer to section 8.2.1 'Destinations' in PDF Reference Manual for more details.

Public Methods

public static Destination createFit (Page 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.

Parameters
page the destination page
Returns
  • the created destination

public static Destination createFitB (Page 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.

Parameters
page the destination page
Returns
  • the created destination

public static Destination createFitBH (Page page, double top)

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.

Parameters
page the destination page
top the vertical coordinate to be at the top of the window
Returns
  • the created destination

public static Destination createFitBV (Page page, double left)

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.

Parameters
page the destination page
left the horizontal coordinate to be at the left edge of the window
Returns
  • the created destination

public static Destination createFitH (Page page, double top)

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.

Parameters
page the destination page
top the vertical coordinate to be at the top of the window
Returns
  • the created destination

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

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.

Parameters
page the destination page
left the horizontal coordinate to be at the left edge of the window
bottom the vertical coordinate to be at the bottom of the window
right the horizontal coordinate to be at the right edge of the window
top the vertical coordinate to be at the top of the window
Returns
  • the created destination

public static Destination createFitV (Page page, double left)

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.

Parameters
page the destination page
left the horizontal coordinate to be at the left edge of the window
Returns
  • the created destination

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

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.

Parameters
page the destination page
left x coordinate of the destination
top y coordinate of the destination
zoom the zoom factor
Returns
  • the created destination

public Obj getExplicitDestObj ()

Get the explicit destination object.

Returns
  • the explicit destination SDF/Cos object. This is always an Array as shown in Table 8.2 in PDF Reference Manual.

public int getFitType ()

Get the Destination fit type.

Returns
  • destination's FitType.

public Page getPage ()

Get the destination page

Returns
  • the Page that this destination refers to.

public Obj getSDFObj ()

Get the SDFObj.

Returns
  • 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

public boolean isValid ()

Checks if Destination is valid.

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

Returns
  • True if this is a valid Destination and can be resolved, false otherwise.

public void setPage (Page page)

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

Parameters
page The new page associated with this Destination.