Foxit PDF SDK

Instance Methods | Class Methods | List of all members
FSDestination Class Reference
Inheritance diagram for FSDestination:

## Instance Methods
(float) | - getBottom
| Get bottom position value. More...
(FSPDFArray *) | - getDestArray
| Get the destination PDF array. More...
(float) | - getLeft
| Get left position value. More...
(int) | - getPageIndex:
| 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...
(FSDestinationZoomMode) | - getZoomMode
| Get the zoom mode. More...
(id) | - initWithDest_array:
| Constructor, with a specified PDF array object. More...
(id) | - initWithOther:
| Constructor, with another destination object. 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...

## Class Methods
(FSDestination *) | + createFitBBox:page_index:
| Create a destination object for zoom mode FSDestinationZoomFitBBox. More...
(FSDestination *) | + createFitBHorz:page_index:top:
| Create a destination object for zoom mode FSDestinationZoomFitBHorz. More...
(FSDestination *) | + createFitBVert:page_index:left:
| Create a destination object for zoom mode FSDestinationZoomFitBVert. More...
(FSDestination *) | + createFitHorz:page_index:top:
| Create a destination object for zoom mode FSDestinationZoomFitHorz. More...
(FSDestination *) | + createFitPage:page_index:
| Create a destination object for zoom mode FSDestinationZoomFitPage. More...
(FSDestination *) | + createFitRect:page_index:left:bottom:right:top:
| Create a destination object for zoom mode FSDestinationZoomFitRect. More...
(FSDestination *) | + createFitVert:page_index:left:
| Create a destination object for zoom mode FSDestinationZoomFitVert. More...
(FSDestination *) | + createFromPDFArray:pdf_array:
| Create a destination object from an existing destination array. More...
(FSDestination *) | + createXYZ:page_index:left:top:zoom_factor:
| Create a destination object for zoom mode FSDestinationZoomXYZ. 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
  FSBookmark
  FSGotoAction
  FSRemoteGotoAction
  FSEmbeddedGotoAction

## Method Documentation

## ◆ createFitBBox:page_index:()

+ (FSDestination *) createFitBBox: |  | (FSPDFDoc*) | document
page_index: |  | (int) | page_index

Create a destination object for zoom mode FSDestinationZoomFitBBox.

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:page_index:top:()

+ (FSDestination *) createFitBHorz: |  | (FSPDFDoc*) | document
page_index: |  | (int) | page_index
top: |  | (float) | top

Create a destination object for zoom mode FSDestinationZoomFitBHorz.

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:page_index:left:()

+ (FSDestination *) createFitBVert: |  | (FSPDFDoc*) | document
page_index: |  | (int) | page_index
left: |  | (float) | left

Create a destination object for zoom mode FSDestinationZoomFitBVert.

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:page_index:top:()

+ (FSDestination *) createFitHorz: |  | (FSPDFDoc*) | document
page_index: |  | (int) | page_index
top: |  | (float) | top

Create a destination object for zoom mode FSDestinationZoomFitHorz.

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

+ (FSDestination *) createFitPage: |  | (FSPDFDoc*) | document
page_index: |  | (int) | page_index

Create a destination object for zoom mode FSDestinationZoomFitPage.

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:page_index:left:bottom:right:top:()

+ (FSDestination *) createFitRect: |  | (FSPDFDoc*) | document
page_index: |  | (int) | page_index
left: |  | (float) | left
bottom: |  | (float) | bottom
right: |  | (float) | right
top: |  | (float) | top

Create a destination object for zoom mode FSDestinationZoomFitRect.

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:page_index:left:()

+ (FSDestination *) createFitVert: |  | (FSPDFDoc*) | document
page_index: |  | (int) | page_index
left: |  | (float) | left

Create a destination object for zoom mode FSDestinationZoomFitVert.

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

+ (FSDestination *) createFromPDFArray: |  | (FSPDFDoc*) | document
pdf_array: |  | (FSPDFArray*) | pdf_array

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 FSPDFNameTree in type FSPDFNameTreeDests.

Returns
  A new destination object.

## ◆ createXYZ:page_index:left:top:zoom_factor:()

+ (FSDestination *) createXYZ: |  | (FSPDFDoc*) | document
page_index: |  | (int) | page_index
left: |  | (float) | left
top: |  | (float) | top
zoom_factor: |  | (float) | zoom_factor

Create a destination object for zoom mode FSDestinationZoomXYZ.

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.

## ◆ getBottom()

- (float) getBottom |  |  |

Get bottom position value.

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

Returns
  The bottom position value.

## ◆ getDestArray()

- (FSPDFArray *) getDestArray |  |  |

Get the destination PDF array.

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

## ◆ getLeft()

- (float) getLeft |  |  |

Get left position value.

This is only useful when zoom mode is FSDestinationZoomXYZ, FSDestinationZoomFitVert, FSDestinationZoomFitRect or FSDestinationZoomFitBVert. Specially for FSDestinationZoomXYZ, FSDestinationZoomFitVert and FSDestinationZoomFitBVert, 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 FSDestination::isLeftNull.
For other zoom modes, this function will return 0.0f.

Returns
  The left position value.

## ◆ getPageIndex:()

- (int) getPageIndex: |  | (FSPDFDoc*) | document |

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

Get right position value.

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

Returns
  The right position value.

## ◆ getTop()

- (float) getTop |  |  |

Get top position value.

This is only useful when zoom mode is FSDestinationZoomXYZ, FSDestinationZoomFitHorz, FSDestinationZoomFitBHorz or FSDestinationZoomFitRect. Specially for FSDestinationZoomXYZ, FSDestinationZoomFitHorz and FSDestinationZoomFitBHorz, 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 FSDestination::isTopNull.
For other zoom modes, this function will return 0.0f.

Returns
  The top position value.

## ◆ getZoomFactor()

- (float) getZoomFactor |  |  |

Get zoom factor.

This is only useful when zoom mode is FSDestinationZoomXYZ. For FSDestinationZoomXYZ, 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()

- (FSDestinationZoomMode) getZoomMode |  |  |

Get the zoom mode.

Returns
  Zoom mode value. Please refer to values starting from FSDestinationZoomXYZ and this would be one of these values. If no zoom mode or zoom mode is unknown, this function will return 0.

## ◆ initWithDest_array:()

- (id) initWithDest_array: |  | (FSPDFArray*) | dest_array |

Constructor, with a specified PDF array object.

Parameters

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

## ◆ initWithOther:()

- (id) initWithOther: |  | (FSDestination*) | other |

Constructor, with another destination object.

Parameters

  [in] | other | Another destination object.

## ◆ isEmpty()

- (BOOL) isEmpty |  |  |

Check whether current object is empty or not.

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

Returns
  YES means current object is empty, while NO means not.

## ◆ isLeftNull()

- (BOOL) isLeftNull |  |  |

Check if left value is a null object.

This is only useful when zoom mode is FSDestinationZoomXYZ, FSDestinationZoomFitVert or FSDestinationZoomFitBVert. This function can be used to check if the left value is a null object. For other zoom modes, this function will return NO.

Returns
  YES means left value is a null object, and NO means left value is not a null object and the left value can be retrieved by function FSDestination::getLeft.

## ◆ isTopNull()

- (BOOL) isTopNull |  |  |

Check if top value is a null object.

This is only useful when zoom mode is FSDestinationZoomXYZ, FSDestinationZoomFitHorz, or FSDestinationZoomFitBHorz. This function can be used to check if the top value is a null object. For other zoom modes, this function will return NO.

Returns
  YES means top value is a null object, and NO means top value is not a null object and the top value can be retrieved by function FSDestination::getTop.