foxit.pdf.actions.Destination Class Reference
Inheritance diagram for foxit.pdf.actions.Destination:
foxit.common.Base

Public Types

enum  ZoomMode {
  ZoomMode.e_ZoomXYZ = 1, ZoomMode.e_ZoomFitPage = 2, ZoomMode.e_ZoomFitHorz = 3, ZoomMode.e_ZoomFitVert = 4,
  ZoomMode.e_ZoomFitRect = 5, ZoomMode.e_ZoomFitBBox = 6, ZoomMode.e_ZoomFitBHorz = 7, ZoomMode.e_ZoomFitBVert = 8
}
 Enumeration for zoom mode.
More...
 

Public Member Functions

 Destination (PDFArray dest_array)
 Constructor, with a specified PDF array object.
More...
 
 Destination (Destination other)
 Constructor, with another Destination object.

 
float GetBottom ()
 Get bottom position value.
More...
 
PDFArray GetDestArray ()
 Get the destination PDF array.
More...
 
float GetLeft ()
 Get left position value.
More...
 
int GetPageIndex (PDFDoc document)
 Get the index of the destination page.
More...
 
float GetRight ()
 Get right position value.
More...
 
float GetTop ()
 Get top position value.
More...
 
float GetZoomFactor ()
 Get zoom factor.
More...
 
Destination.ZoomMode GetZoomMode ()
 Get the zoom mode.
More...
 
bool IsEmpty ()
 Check whether current object is empty or not.
More...
 
bool IsLeftNull ()
 Check if left value is a null object.
More...
 
bool IsTopNull ()
 Check if top value is a null object.
More...
 

Static Public Member Functions

static Destination CreateFitBBox (PDFDoc document, int page_index)
 Create a Destination object for zoom mode e_ZoomFitBBox.
More...
 
static Destination CreateFitBHorz (PDFDoc document, int page_index, float top)
 Create a Destination object for zoom mode e_ZoomFitBHorz.
More...
 
static Destination CreateFitBVert (PDFDoc document, int page_index, float left)
 Create a Destination object for zoom mode e_ZoomFitBVert.
More...
 
static Destination CreateFitHorz (PDFDoc document, int page_index, float top)
 Create a Destination object for zoom mode e_ZoomFitHorz.
More...
 
static Destination CreateFitPage (PDFDoc document, int page_index)
 Create a Destination object for zoom mode e_ZoomFitPage.
More...
 
static Destination CreateFitRect (PDFDoc document, int page_index, float left, float bottom, float right, float top)
 Create a Destination object for zoom mode e_ZoomFitRect.
More...
 
static Destination CreateFitVert (PDFDoc document, int page_index, float left)
 Create a Destination object for zoom mode e_ZoomFitVert.
More...
 
static Destination CreateFromPDFArray (PDFDoc document, PDFArray pdf_array)
 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)
 Create a Destination object for zoom mode e_ZoomXYZ.
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 mode, and get destination data.

See also
pdf::Bookmark
GotoAction
RemoteGotoAction
EmbeddedGotoAction

Member Enumeration Documentation

◆ ZoomMode

Enumeration for zoom mode.

Values of this enumeration should be used alone.

Enumerator
e_ZoomXYZ 

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.

e_ZoomFitPage 

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_ZoomFitHorz 

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_ZoomFitVert 

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_ZoomFitRect 

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_ZoomFitBBox 

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 

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 

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.

Constructor & Destructor Documentation

◆ Destination()

foxit.pdf.actions.Destination.Destination ( PDFArray  dest_array)
inline

Constructor, with a specified PDF array object.

Parameters
dest_arrayA PDF array object that represents destination data.

Member Function Documentation

◆ CreateFitBBox()

static Destination foxit.pdf.actions.Destination.CreateFitBBox ( PDFDoc  document,
int  page_index 
)
inlinestatic

Create a Destination object for zoom mode e_ZoomFitBBox.

Parameters
documentA valid PDF document object.
page_indexThe index of the destination page in the PDF document.
Returns
A new Destination object.

◆ CreateFitBHorz()

static Destination foxit.pdf.actions.Destination.CreateFitBHorz ( PDFDoc  document,
int  page_index,
float  top 
)
inlinestatic

Create a Destination object for zoom mode e_ZoomFitBHorz.

Parameters
documentA valid PDF document object.
page_indexThe index of the destination page in the PDF document.
topThe vertical coordinate of top edge
Returns
A new Destination object.

◆ CreateFitBVert()

static Destination foxit.pdf.actions.Destination.CreateFitBVert ( PDFDoc  document,
int  page_index,
float  left 
)
inlinestatic

Create a Destination object for zoom mode e_ZoomFitBVert.

Parameters
documentA valid PDF document object.
page_indexThe index of the destination page in the PDF document.
leftHorizontal coordinate of left edge.
Returns
A new Destination object.

◆ CreateFitHorz()

static Destination foxit.pdf.actions.Destination.CreateFitHorz ( PDFDoc  document,
int  page_index,
float  top 
)
inlinestatic

Create a Destination object for zoom mode e_ZoomFitHorz.

Parameters
documentA valid PDF document object.
page_indexThe index of the destination page in the PDF document.
topVertical coordinate of top edge.
Returns
A new Destination object.

◆ CreateFitPage()

static Destination foxit.pdf.actions.Destination.CreateFitPage ( PDFDoc  document,
int  page_index 
)
inlinestatic

Create a Destination object for zoom mode e_ZoomFitPage.

Parameters
documentA valid PDF document object.
page_indexThe index of the destination page in the PDF document.
Returns
A new Destination object.

◆ CreateFitRect()

static Destination foxit.pdf.actions.Destination.CreateFitRect ( PDFDoc  document,
int  page_index,
float  left,
float  bottom,
float  right,
float  top 
)
inlinestatic

Create a Destination object for zoom mode e_ZoomFitRect.

Parameters
documentA valid PDF document object.
page_indexThe index of the destination page in the PDF document.
leftThe coordinate left of a rectangle.
bottomThe coordinate bottom of a rectangle.
rightThe coordinate right of a rectangle.
topThe coordinate top of a rectangle.
Returns
A new Destination object.

◆ CreateFitVert()

static Destination foxit.pdf.actions.Destination.CreateFitVert ( PDFDoc  document,
int  page_index,
float  left 
)
inlinestatic

Create a Destination object for zoom mode e_ZoomFitVert.

Parameters
documentA valid PDF document object.
page_indexThe index of the destination page in the PDF document.
leftHorizontal coordinate of left edge.
Returns
A new Destination object.

◆ CreateFromPDFArray()

static Destination foxit.pdf.actions.Destination.CreateFromPDFArray ( PDFDoc  document,
PDFArray  pdf_array 
)
inlinestatic

Create a Destination object from an existing destination array.

Parameters
documentA valid PDF document object.
pdf_arrayA destination PDF array. This PDF array can be retrieved from a PDFNameTree in type e_Dests.
Returns
A new Destination object.

◆ CreateXYZ()

static Destination foxit.pdf.actions.Destination.CreateXYZ ( PDFDoc  document,
int  page_index,
float  left,
float  top,
float  zoom_factor 
)
inlinestatic

Create a Destination object for zoom mode e_ZoomXYZ.

Parameters
documentA valid PDF document object.
page_indexThe index of the destination page in the PDF document.
leftHorizontal coordinate value of a position as page's left-top position.
topVertical coordinate value of a position as page's left-top position.
zoom_factorZoom factor value.
Returns
A new Destination object.

◆ GetBottom()

float foxit.pdf.actions.Destination.GetBottom ( )
inline

Get bottom position value.

This is only useful when zoom mode is e_ZoomFitRect. For other zoom mode, this function will be 0.0f.

Returns
The bottom position value.

◆ GetDestArray()

PDFArray foxit.pdf.actions.Destination.GetDestArray ( )
inline

Get the destination PDF array.

Returns
The destination PDF array.

◆ GetLeft()

◆ GetPageIndex()

int foxit.pdf.actions.Destination.GetPageIndex ( PDFDoc  document)
inline

Get the index of the destination page.

Parameters
documentA valid PDF document object.
Returns
The page index, starting from 0. If there is any error, this function will return -1.

◆ GetRight()

float foxit.pdf.actions.Destination.GetRight ( )
inline

Get right position value.

This is only useful when zoom mode is e_ZoomFitRect. For other zoom mode, this function will be 0.0f.

Returns
The right position value.

◆ GetTop()

◆ GetZoomFactor()

float foxit.pdf.actions.Destination.GetZoomFactor ( )
inline

Get zoom factor.

This is only useful when zoom mode is e_ZoomXYZ. For 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 mode, this function will be 0.0f.

Returns
The zoom factor.

◆ GetZoomMode()

Destination.ZoomMode foxit.pdf.actions.Destination.GetZoomMode ( )
inline

Get the zoom mode.

Returns
Zoom mode value. Please refer to e_ZoomXXX values and it would be one of them. If no zoom mode or zoom mode is unknown, this function will return 0.

◆ IsEmpty()

bool foxit.pdf.actions.Destination.IsEmpty ( )
inline

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

bool foxit.pdf.actions.Destination.IsLeftNull ( )
inline

Check if left value is a null object.

This is only useful when zoom mode is e_ZoomXYZ, e_ZoomFitVert or {}. This function can be used to check if the left value is a null object. For other zoom mode, 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()

bool foxit.pdf.actions.Destination.IsTopNull ( )
inline

Check if top value is a null object.

This is only useful when zoom mode is e_ZoomXYZ, e_ZoomFitHorz, or {}. This function can be used to check if the top value is a null object. For other zoom mode, 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.

Foxit Software Corporation Logo
@2018 Foxit Software Incorporated. All rights reserved.