Foxit PDF SDK

Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
com.foxit.sdk.pdf.actions.Destination Class Reference
Inheritance diagram for com.foxit.sdk.pdf.actions.Destination:

## Public Member Functions
| Destination (Destination other)
| Constructor, with another destination object. More...
| Destination (PDFArray dest_array)
| Constructor, with a specified PDF array object. More...
synchronized void | delete ()
| Clean up related C++ resources immediately. More...
float | getBottom () throws com.foxit.sdk.PDFException
| Get bottom position value. More...
PDFArray | getDestArray () throws com.foxit.sdk.PDFException
| Get the destination PDF array. More...
float | getLeft () throws com.foxit.sdk.PDFException
| Get left position value. More...
int | getPageIndex (PDFDoc document) throws com.foxit.sdk.PDFException
| Get the index of the destination page. More...
float | getRight () throws com.foxit.sdk.PDFException
| Get right position value. More...
float | getTop () throws com.foxit.sdk.PDFException
| Get top position value. More...
float | getZoomFactor () throws com.foxit.sdk.PDFException
| Get zoom factor. More...
int | getZoomMode () throws com.foxit.sdk.PDFException
| Get the zoom mode. More...
boolean | isEmpty ()
| Check whether current object is empty or not. More...
boolean | isLeftNull () throws com.foxit.sdk.PDFException
| Check if left value is a null object. More...
boolean | isTopNull () throws com.foxit.sdk.PDFException
| Check if top value is a null object. More...

## Static Public Member Functions
static Destination | createFitBBox (PDFDoc document, int page_index) throws com.foxit.sdk.PDFException
| Create a destination object for zoom mode com.foxit.sdk.pdf.actions.Destination.e_ZoomFitBBox . More...
static Destination | createFitBHorz (PDFDoc document, int page_index, float top) throws com.foxit.sdk.PDFException
| Create a destination object for zoom mode com.foxit.sdk.pdf.actions.Destination.e_ZoomFitBHorz . More...
static Destination | createFitBVert (PDFDoc document, int page_index, float left) throws com.foxit.sdk.PDFException
| Create a destination object for zoom mode com.foxit.sdk.pdf.actions.Destination.e_ZoomFitBVert . More...
static Destination | createFitHorz (PDFDoc document, int page_index, float top) throws com.foxit.sdk.PDFException
| Create a destination object for zoom mode com.foxit.sdk.pdf.actions.Destination.e_ZoomFitHorz . More...
static Destination | createFitPage (PDFDoc document, int page_index) throws com.foxit.sdk.PDFException
| Create a destination object for zoom mode com.foxit.sdk.pdf.actions.Destination.e_ZoomFitPage . More...
static Destination | createFitRect (PDFDoc document, int page_index, float left, float bottom, float right, float top) throws com.foxit.sdk.PDFException
| Create a destination object for zoom mode com.foxit.sdk.pdf.actions.Destination.e_ZoomFitRect . More...
static Destination | createFitVert (PDFDoc document, int page_index, float left) throws com.foxit.sdk.PDFException
| Create a destination object for zoom mode com.foxit.sdk.pdf.actions.Destination.e_ZoomFitVert . More...
static Destination | createFromPDFArray (PDFDoc document, PDFArray pdf_array) throws com.foxit.sdk.PDFException
| Create a destination object from an existing destination array. More...
static Destination | createXYZ (PDFDoc document, int page_index, float left, float top, float zoom_factor) throws com.foxit.sdk.PDFException
| Create a destination object for zoom mode com.foxit.sdk.pdf.actions.Destination.e_ZoomXYZ . More...

## Static Public Attributes
static final int | e_ZoomFitBBox = 6
| Fit the bounding box of page entirely within the display area when display the page. More...
static final int | e_ZoomFitBHorz = 7
| Fit the entire width of the page's bounding box within the display area when display the page. More...
static final int | e_ZoomFitBVert = 8
| Fit the entire height of the page's bounding box within the display area when display the page. More...
static final int | e_ZoomFitHorz = 3
| Fit the entire width of the page within the display area when display the page. More...
static final int | e_ZoomFitPage = 2
| Fit the entire page within the display area when display the page. More...
static final int | e_ZoomFitRect = 5
| Fit the page content in a specified rectangle entirely within the display area when display the page. More...
static final int | e_ZoomFitVert = 4
| Fit the entire height of the page within the display area when display the page. More...
static final int | e_ZoomXYZ = 1
| Display page with a specified position and a specified zoom factor. More...

## Detailed Description

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

- 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, or some types of actions. In each case, the destination specifies the view of the document to be presented when the bookmark item or link annotation is opened or the action is performed.
This class offers functions to create destination objects for different zoom modes, and get destination data.

See also
  com.foxit.sdk.pdf.Bookmark
  com.foxit.sdk.pdf.actions.GotoAction
  com.foxit.sdk.pdf.actions.RemoteGotoAction
  com.foxit.sdk.pdf.actions.EmbeddedGotoAction

## Constructor & Destructor Documentation

## ◆ Destination() [1/2]

com.foxit.sdk.pdf.actions.Destination.Destination | ( | PDFArray | dest_array | ) |

Constructor, with a specified PDF array object.

Parameters

  [in] | dest_array | A PDF array object that represents destination data.

## ◆ Destination() [2/2]

com.foxit.sdk.pdf.actions.Destination.Destination | ( | Destination | other | ) |

Constructor, with another destination object.

Parameters

  [in] | other | Another destination object.

## Member Function Documentation

## ◆ createFitBBox()

static Destination com.foxit.sdk.pdf.actions.Destination.createFitBBox | ( | PDFDoc | document,
|  | int | page_index
| ) |  | throws com.foxit.sdk.PDFException
| static

Create a destination object for zoom mode com.foxit.sdk.pdf.actions.Destination.e_ZoomFitBBox .

Parameters

  [in] | document | A valid PDF document object.
  [in] | page_index | The index of the destination page in the PDF document.

Returns
  A new destination object.

## ◆ createFitBHorz()

static Destination com.foxit.sdk.pdf.actions.Destination.createFitBHorz | ( | PDFDoc | document,
|  | int | page_index,
|  | float | top
| ) |  | throws com.foxit.sdk.PDFException
| static

Create a destination object for zoom mode com.foxit.sdk.pdf.actions.Destination.e_ZoomFitBHorz .

Parameters

  [in] | document | A valid PDF document object.
  [in] | page_index | The index of the destination page in the PDF document.
  [in] | top | The vertical coordinate of top edge

Returns
  A new destination object.

## ◆ createFitBVert()

static Destination com.foxit.sdk.pdf.actions.Destination.createFitBVert | ( | PDFDoc | document,
|  | int | page_index,
|  | float | left
| ) |  | throws com.foxit.sdk.PDFException
| static

Create a destination object for zoom mode com.foxit.sdk.pdf.actions.Destination.e_ZoomFitBVert .

Parameters

  [in] | document | A valid PDF document object.
  [in] | page_index | The index of the destination page in the PDF document.
  [in] | left | Horizontal coordinate of left edge.

Returns
  A new destination object.

## ◆ createFitHorz()

static Destination com.foxit.sdk.pdf.actions.Destination.createFitHorz | ( | PDFDoc | document,
|  | int | page_index,
|  | float | top
| ) |  | throws com.foxit.sdk.PDFException
| static

Create a destination object for zoom mode com.foxit.sdk.pdf.actions.Destination.e_ZoomFitHorz .

Parameters

  [in] | document | A valid PDF document object.
  [in] | page_index | The index of the destination page in the PDF document.
  [in] | top | Vertical coordinate of top edge.

Returns
  A new destination object.

## ◆ createFitPage()

static Destination com.foxit.sdk.pdf.actions.Destination.createFitPage | ( | PDFDoc | document,
|  | int | page_index
| ) |  | throws com.foxit.sdk.PDFException
| static

Create a destination object for zoom mode com.foxit.sdk.pdf.actions.Destination.e_ZoomFitPage .

Parameters

  [in] | document | A valid PDF document object.
  [in] | page_index | The index of the destination page in the PDF document.

Returns
  A new destination object.

## ◆ createFitRect()

static Destination com.foxit.sdk.pdf.actions.Destination.createFitRect | ( | PDFDoc | document,
|  | int | page_index,
|  | float | left,
|  | float | bottom,
|  | float | right,
|  | float | top
| ) |  | throws com.foxit.sdk.PDFException
| static

Create a destination object for zoom mode com.foxit.sdk.pdf.actions.Destination.e_ZoomFitRect .

Parameters

  [in] | document | A valid PDF document object.
  [in] | page_index | The index of the destination page in the PDF document.
  [in] | left | The coordinate left of a rectangle.
  [in] | bottom | The coordinate bottom of a rectangle.
  [in] | right | The coordinate right of a rectangle.
  [in] | top | The coordinate top of a rectangle.

Returns
  A new destination object.

## ◆ createFitVert()

static Destination com.foxit.sdk.pdf.actions.Destination.createFitVert | ( | PDFDoc | document,
|  | int | page_index,
|  | float | left
| ) |  | throws com.foxit.sdk.PDFException
| static

Create a destination object for zoom mode com.foxit.sdk.pdf.actions.Destination.e_ZoomFitVert .

Parameters

  [in] | document | A valid PDF document object.
  [in] | page_index | The index of the destination page in the PDF document.
  [in] | left | Horizontal coordinate of left edge.

Returns
  A new destination object.

## ◆ createFromPDFArray()

static Destination com.foxit.sdk.pdf.actions.Destination.createFromPDFArray | ( | PDFDoc | document,
|  | PDFArray | pdf_array
| ) |  | throws com.foxit.sdk.PDFException
| static

Create a destination object from an existing destination array.

Parameters

  [in] | document | A valid PDF document object.
  [in] | pdf_array | A destination PDF array. This PDF array can be retrieved from a com.foxit.sdk.pdf.objects.PDFNameTree in type com.foxit.sdk.pdf.objects.PDFNameTree.e_Dests .

Returns
  A new destination object.

## ◆ createXYZ()

static Destination com.foxit.sdk.pdf.actions.Destination.createXYZ | ( | PDFDoc | document,
|  | int | page_index,
|  | float | left,
|  | float | top,
|  | float | zoom_factor
| ) |  | throws com.foxit.sdk.PDFException
| static

Create a destination object for zoom mode com.foxit.sdk.pdf.actions.Destination.e_ZoomXYZ .

Parameters

  [in] | document | A valid PDF document object.
  [in] | page_index | The index of the destination page in the PDF document.
  [in] | left | Horizontal coordinate value of a position as page's left-top position.
  [in] | top | Vertical coordinate value of a position as page's left-top position.
  [in] | zoom_factor | Zoom factor value.

Returns
  A new destination object.

## ◆ delete()

synchronized void com.foxit.sdk.pdf.actions.Destination.delete | ( |  | ) |

Clean up related C++ resources immediately.

Returns
  None.

Note
  Once this function is called, current object cannot be used anymore.

Reimplemented from com.foxit.sdk.common.Base.

## ◆ getBottom()

float com.foxit.sdk.pdf.actions.Destination.getBottom | ( |  | ) | throws com.foxit.sdk.PDFException

Get bottom position value.

This is only useful when zoom mode is com.foxit.sdk.pdf.actions.Destination.e_ZoomFitRect . For other zoom modes, this function will be 0.0f.

Returns
  The bottom position value.

## ◆ getDestArray()

PDFArray com.foxit.sdk.pdf.actions.Destination.getDestArray | ( |  | ) | throws com.foxit.sdk.PDFException

Get the destination PDF array.

Returns
  The destination PDF array.If there is any error, this function will return null.

## ◆ getLeft()

float com.foxit.sdk.pdf.actions.Destination.getLeft | ( |  | ) | throws com.foxit.sdk.PDFException

Get left position value.

This is only useful when zoom mode is com.foxit.sdk.pdf.actions.Destination.e_ZoomXYZ , com.foxit.sdk.pdf.actions.Destination.e_ZoomFitVert , com.foxit.sdk.pdf.actions.Destination.e_ZoomFitRect or com.foxit.sdk.pdf.actions.Destination.e_ZoomFitBVert . Specially for com.foxit.sdk.pdf.actions.Destination.e_ZoomXYZ , com.foxit.sdk.pdf.actions.Destination.e_ZoomFitVert and com.foxit.sdk.pdf.actions.Destination.e_ZoomFitBVert , left value may be a null object, which means that just use current left value of application as the destination's left value. For this case, this function will return 0.0f. In order to check if the left value is just 0 or a null object, user is recommended to call function Destination.isLeftNull .
For other zoom modes, this function will return 0.0f.

Returns
  The left position value.

## ◆ getPageIndex()

int com.foxit.sdk.pdf.actions.Destination.getPageIndex | ( | PDFDoc | document | ) | throws com.foxit.sdk.PDFException

Get the index of the destination page.

Parameters

  [in] | document | A valid PDF document object.

Returns
  The page index, starting from 0. If there is any error, this function will return -1.

## ◆ getRight()

float com.foxit.sdk.pdf.actions.Destination.getRight | ( |  | ) | throws com.foxit.sdk.PDFException

Get right position value.

This is only useful when zoom mode is com.foxit.sdk.pdf.actions.Destination.e_ZoomFitRect . For other zoom modes, this function will be 0.0f.

Returns
  The right position value.

## ◆ getTop()

float com.foxit.sdk.pdf.actions.Destination.getTop | ( |  | ) | throws com.foxit.sdk.PDFException

Get top position value.

This is only useful when zoom mode is com.foxit.sdk.pdf.actions.Destination.e_ZoomXYZ , com.foxit.sdk.pdf.actions.Destination.e_ZoomFitHorz , com.foxit.sdk.pdf.actions.Destination.e_ZoomFitBHorz or com.foxit.sdk.pdf.actions.Destination.e_ZoomFitRect . Specially for com.foxit.sdk.pdf.actions.Destination.e_ZoomXYZ , com.foxit.sdk.pdf.actions.Destination.e_ZoomFitHorz and com.foxit.sdk.pdf.actions.Destination.e_ZoomFitBHorz , top value may be a null object, which means that just use current top value of application as the destination's top value. For this case, this function will return 0.0f. In order to check if the left value is just 0 or a null object, user is recommended to call function Destination.isTopNull .
For other zoom modes, this function will return 0.0f.

Returns
  The top position value.

## ◆ getZoomFactor()

float com.foxit.sdk.pdf.actions.Destination.getZoomFactor | ( |  | ) | throws com.foxit.sdk.PDFException

Get zoom factor.

This is only useful when zoom mode is com.foxit.sdk.pdf.actions.Destination.e_ZoomXYZ . For com.foxit.sdk.pdf.actions.Destination.e_ZoomXYZ , if the zoom factor is 0, that means just use current zoom factor of application as the destination zoom factor.
For other zoom modes, this function will be 0.0f.

Returns
  The zoom factor.

## ◆ getZoomMode()

int com.foxit.sdk.pdf.actions.Destination.getZoomMode | ( |  | ) | throws com.foxit.sdk.PDFException

Get the zoom mode.

Returns
  Zoom mode value. Please refer to values starting from com.foxit.sdk.pdf.actions.Destination.e_ZoomXYZ and this would be one of these values. If no zoom mode or zoom mode is unknown, this function will return 0.

## ◆ isEmpty()

boolean com.foxit.sdk.pdf.actions.Destination.isEmpty | ( |  | ) |

Check whether current object is empty or not.

When the current object is empty, that means current object is useless.

Returns
  true means current object is empty, while false means not.

## ◆ isLeftNull()

boolean com.foxit.sdk.pdf.actions.Destination.isLeftNull | ( |  | ) | throws com.foxit.sdk.PDFException

Check if left value is a null object.

This is only useful when zoom mode is com.foxit.sdk.pdf.actions.Destination.e_ZoomXYZ , com.foxit.sdk.pdf.actions.Destination.e_ZoomFitVert or com.foxit.sdk.pdf.actions.Destination.e_ZoomFitBVert . This function can be used to check if the left value is a null object. For other zoom modes, this function will return false.

Returns
  true means left value is a null object, and false means left value is not a null object and the left value can be retrieved by function Destination.getLeft .

## ◆ isTopNull()

boolean com.foxit.sdk.pdf.actions.Destination.isTopNull | ( |  | ) | throws com.foxit.sdk.PDFException

Check if top value is a null object.

This is only useful when zoom mode is com.foxit.sdk.pdf.actions.Destination.e_ZoomXYZ , com.foxit.sdk.pdf.actions.Destination.e_ZoomFitHorz , or com.foxit.sdk.pdf.actions.Destination.e_ZoomFitBHorz . This function can be used to check if the top value is a null object. For other zoom modes, this function will return false.

Returns
  true means top value is a null object, and false means top value is not a null object and the top value can be retrieved by function Destination.getTop .

## Member Data Documentation

## ◆ e_ZoomFitBBox

final int com.foxit.sdk.pdf.actions.Destination.e_ZoomFitBBox = 6
| static

Fit the bounding box of page entirely within the display area when display the page.

If this is used, that means the contents of the page should be magnified just enough to fit its bounding box entirely within the display area 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 display area in the other dimension.

## ◆ e_ZoomFitBHorz

final int com.foxit.sdk.pdf.actions.Destination.e_ZoomFitBHorz = 7
| static

Fit the entire width of the page's bounding box within the display area when display the page.

If this is used, that means the contents of the page should be magnified just enough to fit the entire width of the page's bounding box within the display area.

## ◆ e_ZoomFitBVert

final int com.foxit.sdk.pdf.actions.Destination.e_ZoomFitBVert = 8
| static

Fit the entire height of the page's bounding box within the display area when display the page.

If this is used, that means the contents of the page should be magnified just enough to fit the entire height of the page's bounding box within the display area.

## ◆ e_ZoomFitHorz

final int com.foxit.sdk.pdf.actions.Destination.e_ZoomFitHorz = 3
| static

Fit the entire width of the page within the display area when display the page.

If this is used, that means the contents of the page should be magnified just enough to fit the entire width of the page within the display area.

## ◆ e_ZoomFitPage

final int com.foxit.sdk.pdf.actions.Destination.e_ZoomFitPage = 2
| static

Fit the entire page within the display area when display the page.

If this is used, that means the contents of the page should be magnified just enough to fit the entire page within the display area 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.

## ◆ e_ZoomFitRect

final int com.foxit.sdk.pdf.actions.Destination.e_ZoomFitRect = 5
| static

Fit the page content in a specified rectangle entirely within the display area when display the page.

If this is used, that means the contents of the page should be magnified just enough to fit the page content in the specified rectangle entirely within the display area 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 display area in the other dimension.

## ◆ e_ZoomFitVert

final int com.foxit.sdk.pdf.actions.Destination.e_ZoomFitVert = 4
| static

Fit the entire height of the page within the display area when display the page.

If this is used, that means the contents of the page should be magnified just enough to fit the entire height of the page within the display area.

## ◆ e_ZoomXYZ

final int com.foxit.sdk.pdf.actions.Destination.e_ZoomXYZ = 1
| static

Display page with a specified position and a specified zoom factor.

If this is used, that means the specified position of the page will be treated as the left-top position when the page is rendered and this position should be at the upper-left corner of the display area. Contents of the page should be magnified by the specified zoom factor.