Foxit::PDF::Bookmark Class Reference

Class to access a PDF bookmark. More...

Public Member Functions

BookmarkGetFirstChild ()
 Get the first child bookmark. More...
 
BookmarkGetNextSibling ()
 Get the next sibling bookmark. More...
 
DestinationGetDestination ()
 Get the destination data directly. More...
 
Int32 CountActions ()
 Count the actions. More...
 
ActionGetAction (Int32 index)
 Get an action by index. More...
 

Properties

String^  Title
 Property: bookmark title.
 
UInt32 Color
 Property: bookmark color, which is used for displaying title. Format:0xAARRGGBB and alpha component is omitted (alpha default value: 0xFF).
 
UInt32 Status
 Property: bookmark status. Please refer to enumeration PDF::BookmarkStatus and this should be one or combination of its values.
 
Int64 pointer
 Pointer to a handle of PDF bookmark object. This pointer is not useful outside this SDK. The application should not access the pointer to the handle of the PDF bookmark object directly.
 

Detailed Description

Class to access a PDF bookmark.

PDF bookmark is also called outline. It allows user to navigate PDF document easily by selecting one outline. One bookmark contains a destination or actions to indicate how to response when user selects it. PDF bookmark is a tree-structured hierarchy.
In order to access to the bookmark tree, function Document::GetBookmarkRoot must be called first to get the root of the whole bookmark tree. Here, "root bookmark" is an abstract object. "root bookmark" can only have some child bookmarks but no next sibling bookmarks or any data (including bookmark data, destination data and action data). And "root bookmark" cannot be shown on the application UI since it has no data. So, for a root bookmark, only function Bookmark::GetFirstChild can be used.
After the root bookmark is retrieved, following functions can be called to access other bookmarks:

Member Function Documentation

Int32 Foxit::PDF::Bookmark::CountActions ( )

Count the actions.

Since root bookmark is an abstract object, it doesn't have any actions or other bookmark informations. Please refer to comment of class PDF::Bookmark for more details.

Returns
The count of actions.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::Error means current bookmark is root bookmark or the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.
Action ^ Foxit::PDF::Bookmark::GetAction ( Int32  index)

Get an action by index.

Parameters
[in]indexIndex of action to be retrieved. Range: [0, (actioncount-1)]. actioncount is returned by function Bookmark::CountActions.
Returns
A PDF::Action object.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::NotFound means parameter index is out of range.
ErrorCode::Error means current bookmark is root bookmark or the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.
Destination ^ Foxit::PDF::Bookmark::GetDestination ( )

Get the destination data directly.

This function can get the destination data directly, without through action. If no destination can be retrieved, that may means current bookmark contains actions which are not used to go to somewhere. Please try function Bookmark::GetAction.

Returns
A PDF::Destination class that receives the destination data. If no destination data can be found or there is any error, this function will return nullptr.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::NotFound means current bookmark doesn't have any destination data.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means current bookmark is root bookmark or the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.
Bookmark ^ Foxit::PDF::Bookmark::GetFirstChild ( )

Get the first child bookmark.

Returns
A PDF::Bookmark class that receives the first child bookmark of current one. If no child bookmark can be found or theres is any error, this function will return nullptr.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::NotFound means current bookmark doesn't have any child bookmark.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.
Bookmark ^ Foxit::PDF::Bookmark::GetNextSibling ( )

Get the next sibling bookmark.

Returns
A PDF::Bookmark class that receives the next sibling bookmark. If no next sibling bookmark can be found or there is any error, this function will return nullptr.
Call function Library::GetLastError after this function returns, to get the error code.
ErrorCode::Success means success.
ErrorCode::NotFound means current bookmark doesn't have a next sibling bookmark.
ErrorCode::OutOfMemory means there is no enough memory or the memory access is wrong.
ErrorCode::Error means current bookmark is root bookmark or the function fails because of any other reasons.
For more error code values, please refer to enumeration Foxit::ErrorCode.

Foxit Corporation