Foxit PDF SDK
|
Public Types | |
enum | ZoomMode { e_ZoomXYZ = 1, e_ZoomFitPage = 2, e_ZoomFitHorz = 3, e_ZoomFitVert = 4, e_ZoomFitRect = 5, e_ZoomFitBBox = 6, e_ZoomFitBHorz = 7, e_ZoomFitBVert = 8 } |
Enumeration for zoom mode. More... | |
Public Member Functions | |
Destination (objects::PDFArray *dest_array) | |
Constructor, with a specified PDF array object. More... | |
Destination (const Destination &other) | |
Constructor, with another destination object. More... | |
~Destination () | |
Destructor. | |
float | GetBottom () const |
Get bottom position value. More... | |
objects::PDFArray * | GetDestArray () const |
Get the destination PDF array. More... | |
float | GetLeft () const |
Get left position value. More... | |
int | GetPageIndex (const PDFDoc &document) const |
Get the index of the destination page. More... | |
float | GetRight () const |
Get right position value. More... | |
float | GetTop () const |
Get top position value. More... | |
float | GetZoomFactor () const |
Get zoom factor. More... | |
Destination::ZoomMode | GetZoomMode () const |
Get the zoom mode. More... | |
bool | IsEmpty () const |
Check whether current object is empty or not. More... | |
bool | IsLeftNull () const |
Check if left value is a null object. More... | |
bool | IsTopNull () const |
Check if top value is a null object. More... | |
bool | operator != (const Destination &other) const |
Not equal operator. More... | |
Destination & | operator= (const Destination &other) |
Assign operator. More... | |
bool | operator== (const Destination &other) const |
Equal operator. More... | |
![]() | |
FS_HANDLE | Handle () const |
Get the handle of current object. More... | |
Static Public Member Functions | |
static Destination | CreateFitBBox (const PDFDoc &document, int page_index) |
Create a destination object for zoom mode Destination::e_ZoomFitBBox. More... | |
static Destination | CreateFitBHorz (const PDFDoc &document, int page_index, float top) |
Create a destination object for zoom mode Destination::e_ZoomFitBHorz. More... | |
static Destination | CreateFitBVert (const PDFDoc &document, int page_index, float left) |
Create a destination object for zoom mode Destination::e_ZoomFitBVert. More... | |
static Destination | CreateFitHorz (const PDFDoc &document, int page_index, float top) |
Create a destination object for zoom mode Destination::e_ZoomFitHorz. More... | |
static Destination | CreateFitPage (const PDFDoc &document, int page_index) |
Create a destination object for zoom mode Destination::e_ZoomFitPage. More... | |
static Destination | CreateFitRect (const PDFDoc &document, int page_index, float left, float bottom, float right, float top) |
Create a destination object for zoom mode Destination::e_ZoomFitRect. More... | |
static Destination | CreateFitVert (const PDFDoc &document, int page_index, float left) |
Create a destination object for zoom mode Destination::e_ZoomFitVert. More... | |
static Destination | CreateFromPDFArray (const PDFDoc &document, objects::PDFArray *pdf_array) |
Create a destination object from an existing destination array. More... | |
static Destination | CreateXYZ (const PDFDoc &document, int page_index, float left, float top, float zoom_factor) |
Create a destination object for zoom mode Destination::e_ZoomXYZ. More... | |
A destination defines a particular view of a PDF document, consisting of the following items:
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.
Enumeration for zoom mode.
Values of this enumeration should be used alone.
|
explicit |
Constructor, with a specified PDF array object.
[in] | dest_array | A PDF array object that represents destination data. |
foxit::pdf::Destination::Destination | ( | const Destination & | other | ) |
Constructor, with another destination object.
[in] | other | Another destination object. |
|
static |
Create a destination object for zoom mode Destination::e_ZoomFitBBox.
[in] | document | A valid PDF document object. |
[in] | page_index | The index of the destination page in the PDF document. |
|
static |
Create a destination object for zoom mode Destination::e_ZoomFitBHorz.
[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 |
|
static |
Create a destination object for zoom mode Destination::e_ZoomFitBVert.
[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. |
|
static |
Create a destination object for zoom mode Destination::e_ZoomFitHorz.
[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. |
|
static |
Create a destination object for zoom mode Destination::e_ZoomFitPage.
[in] | document | A valid PDF document object. |
[in] | page_index | The index of the destination page in the PDF document. |
|
static |
Create a destination object for zoom mode Destination::e_ZoomFitRect.
[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. |
|
static |
Create a destination object for zoom mode Destination::e_ZoomFitVert.
[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. |
|
static |
Create a destination object from an existing destination array.
[in] | document | A valid PDF document object. |
[in] | pdf_array | A destination PDF array. This PDF array can be retrieved from a objects::PDFNameTree in type objects::PDFNameTree::e_Dests. |
|
static |
Create a destination object for zoom mode Destination::e_ZoomXYZ.
[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. |
float foxit::pdf::Destination::GetBottom | ( | ) | const |
Get bottom position value.
This is only useful when zoom mode is Destination::e_ZoomFitRect. For other zoom mode, this function will be 0.0f.
objects::PDFArray* foxit::pdf::Destination::GetDestArray | ( | ) | const |
Get the destination PDF array.
float foxit::pdf::Destination::GetLeft | ( | ) | const |
Get left position value.
This is only useful when zoom mode is Destination::e_ZoomXYZ, Destination::e_ZoomFitVert, Destination::e_ZoomFitRect or Destination::e_ZoomFitBVert. Specially for Destination::e_ZoomXYZ, Destination::e_ZoomFitVert and 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 mode, this function will return 0.0f.
int foxit::pdf::Destination::GetPageIndex | ( | const PDFDoc & | document | ) | const |
Get the index of the destination page.
[in] | document | A valid PDF document object. |
float foxit::pdf::Destination::GetRight | ( | ) | const |
Get right position value.
This is only useful when zoom mode is Destination::e_ZoomFitRect. For other zoom mode, this function will be 0.0f.
float foxit::pdf::Destination::GetTop | ( | ) | const |
Get top position value.
This is only useful when zoom mode is Destination::e_ZoomXYZ, Destination::e_ZoomFitHorz, Destination::e_ZoomFitBHorz or Destination::e_ZoomFitRect. Specially for Destination::e_ZoomXYZ, Destination::e_ZoomFitHorz and 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 mode, this function will return 0.0f.
float foxit::pdf::Destination::GetZoomFactor | ( | ) | const |
Get zoom factor.
This is only useful when zoom mode is Destination::e_ZoomXYZ. For 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 mode, this function will be 0.0f.
Destination::ZoomMode foxit::pdf::Destination::GetZoomMode | ( | ) | const |
Get the zoom mode.
bool foxit::pdf::Destination::IsEmpty | ( | ) | const |
Check whether current object is empty or not.
When the current object is empty, that means current object is useless.
bool foxit::pdf::Destination::IsLeftNull | ( | ) | const |
Check if left value is a null object.
This is only useful when zoom mode is Destination::e_ZoomXYZ, Destination::e_ZoomFitVert or Destination::e_ZoomFitBVert. This function can be used to check if the left value is a null object. For other zoom mode, this function will return false.
bool foxit::pdf::Destination::IsTopNull | ( | ) | const |
Check if top value is a null object.
This is only useful when zoom mode is Destination::e_ZoomXYZ, Destination::e_ZoomFitHorz, or Destination::e_ZoomFitBHorz. This function can be used to check if the top value is a null object. For other zoom mode, this function will return false.
bool foxit::pdf::Destination::operator != | ( | const Destination & | other | ) | const |
Not equal operator.
[in] | other | Another destination object. This function will check if current object is not equal to this one. |
Destination& foxit::pdf::Destination::operator= | ( | const Destination & | other | ) |
Assign operator.
[in] | other | Another destination object, whose value would be assigned to current object. |
bool foxit::pdf::Destination::operator== | ( | const Destination & | other | ) | const |
Equal operator.
[in] | other | Another destination object. This function will check if current object is equal to this one. |