Foxit PDF SDK
|
Public Member Functions | |
def | Bookmark (pdf_doc, bookmark_dict) |
Constructor, with parameters. More... | |
def | GetAction () |
Get action. More... | |
def | GetColor () |
Get the color used for displaying title. More... | |
def | GetDestination () |
Get the destination. More... | |
def | GetDict () |
Get PDF dictionary of current bookmark. More... | |
def | GetFirstChild () |
Get the first child bookmark. More... | |
def | GetNextSibling () |
Get the next sibling bookmark. More... | |
def | GetParent () |
Get the parent bookmark. More... | |
def | GetStyle () |
Get the style. More... | |
def | GetTitle () |
Get the title. More... | |
def | HasChild () |
Check if current bookmark has child bookmark(s). More... | |
def | Insert (title, position) |
Insert a new bookmark according to the relationship position to current bookmark. More... | |
def | IsEmpty () |
Check whether current object is empty or not. More... | |
def | IsFirstChild () |
Check if current bookmark is the first child of its parent bookmark. More... | |
def | IsLastChild () |
Check if current bookmark is the last child of its parent bookmark. More... | |
def | IsRoot () |
Check if current bookmark is the root bookmark. More... | |
def | MoveTo (dest_bookmark, position) |
Move current bookmark to be child or sibling of another bookmark. More... | |
def | RemoveAction () |
Remove action. More... | |
def | SetAction (action) |
Set action. More... | |
def | SetColor (color) |
Set the color used for displaying title. More... | |
def | SetDestination (destination) |
Set the destination. More... | |
def | SetStyle (style) |
Set the style. More... | |
def | SetTitle (title) |
Set the title. More... | |
Static Public Attributes | |
e_PosFirstChild = _fsdk.Bookmark_e_PosFirstChild | |
A bookmark is the first child of another specified bookmark. | |
e_PosFirstSibling = _fsdk.Bookmark_e_PosFirstSibling | |
A bookmark is the first sibling of another specified bookmark. | |
e_PosLastChild = _fsdk.Bookmark_e_PosLastChild | |
A bookmark is the last child of another specified bookmark. | |
e_PosLastSibling = _fsdk.Bookmark_e_PosLastSibling | |
A bookmark is the last sibling of another specified bookmark. | |
e_PosNextSibling = _fsdk.Bookmark_e_PosNextSibling | |
A bookmark is the next sibling of another specified bookmark. | |
e_PosPrevSibling = _fsdk.Bookmark_e_PosPrevSibling | |
A bookmark is the previous sibling of another specified bookmark. | |
e_StyleBold = _fsdk.Bookmark_e_StyleBold | |
Show bookmark title as bold text. | |
e_StyleItalic = _fsdk.Bookmark_e_StyleItalic | |
Show bookmark title as italic text. | |
e_StyleNormal = _fsdk.Bookmark_e_StyleNormal | |
Show bookmark title as normal text. | |
PDF bookmark is also called "outline". It's a tree-structured hierarchy. It allows user to navigate PDF document easily by selecting a bookmark. One bookmark contains a destination or actions to indicate how to response when user selects it.
In order to get/set the bookmark tree, function FoxitPDFSDKPython2.PDFDoc.GetRootBookmark must be called first to get the root of the whole bookmark tree. If the "root bookmark" does not exist, function FoxitPDFSDKPython2.PDFDoc.CreateRootBookmark could be called to create a new "root bookmark". Here, "root
bookmark" is an abstract object. It represents the "Outline" of PDF document. For more details about "Outline", please refer to Section 8.2.3 in PDF Reference 1.7. "root bookmark" can only have some child bookmarks, but no parent, 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 FoxitPDFSDKPython2.Bookmark.GetFirstChild can be used.
From the root bookmark, the bookmark tree can be traversed and each bookmark node can be accessed.
This class offers several functions to get/set other bookmarks from current bookmark. For example:
To access the parent bookmark, use function FoxitPDFSDKPython2.Bookmark.GetParent .
To access the first child bookmark, use function FoxitPDFSDKPython2.Bookmark.GetFirstChild .
To access the next sibling bookmark, use function FoxitPDFSDKPython2.Bookmark.GetNextSibling .
To Insert a new bookmark, use function FoxitPDFSDKPython2.Bookmark.Insert .
To move a bookmark, use function FoxitPDFSDKPython2.Bookmark.MoveTo .
This class also offers functions to get/set the data of a PDF bookmark.
def FoxitPDFSDKPython2.Bookmark.Bookmark | ( | pdf_doc, | |
bookmark_dict | |||
) |
Constructor, with parameters.
Constructor, with another bookmark object.
[in] | pdf_doc | A valid PDF document object. |
[in] | bookmark_dict | A PDF dictionary which represents a bookmark. This PDF dictionary should have existed in the PDF document represented by parameter pdf_doc. |
[in] | other | Another bookmark object. |
def FoxitPDFSDKPython2.Bookmark.GetAction | ( | ) |
Get action.
If current bookmark is returned by function FoxitPDFSDKPython2.PDFDoc.GetRootBookmark or FoxitPDFSDKPython2.PDFDoc.CreateRootBookmark , that means it is the "root bookmark", and it does not have any action information. In this case, this function will return an action object which's function FoxitPDFSDKPython2.Action.IsEmpty returns true.
def FoxitPDFSDKPython2.Bookmark.GetColor | ( | ) |
Get the color used for displaying title.
If current bookmark is returned by function FoxitPDFSDKPython2.PDFDoc.GetRootBookmark or FoxitPDFSDKPython2.PDFDoc.CreateRootBookmark , that means it is the "root bookmark", and it does not have color. In this case, this function will return 0x000000 by default.
def FoxitPDFSDKPython2.Bookmark.GetDestination | ( | ) |
Get the destination.
Bookmark's destination is some place in current document where the bookmark can "goto". If the bookmark cannot "goto" any place in current document, that means no destination information can be retrieved and this function will return a destination object which's function FoxitPDFSDKPython2.Destination.IsEmpty returns true.
If current bookmark is returned by function FoxitPDFSDKPython2.PDFDoc.GetRootBookmark or FoxitPDFSDKPython2.PDFDoc.CreateRootBookmark , that means it is the "root bookmark", and it does not have any destination information. In this case, this function will return a destination object which's function FoxitPDFSDKPython2.Destination.IsEmpty returns true.
def FoxitPDFSDKPython2.Bookmark.GetDict | ( | ) |
Get PDF dictionary of current bookmark.
def FoxitPDFSDKPython2.Bookmark.GetFirstChild | ( | ) |
Get the first child bookmark.
def FoxitPDFSDKPython2.Bookmark.GetNextSibling | ( | ) |
Get the next sibling bookmark.
If current bookmark is returned by function FoxitPDFSDKPython2.PDFDoc.GetRootBookmark or FoxitPDFSDKPython2.PDFDoc.CreateRootBookmark , that means it is the "root bookmark", and it does not have any sibling bookmark. In this case, this function will return a bookmark object which's function FoxitPDFSDKPython2.Bookmark.IsEmpty returns true.
def FoxitPDFSDKPython2.Bookmark.GetParent | ( | ) |
Get the parent bookmark.
If current bookmark is returned by function FoxitPDFSDKPython2.PDFDoc.GetRootBookmark or FoxitPDFSDKPython2.PDFDoc.CreateRootBookmark , that means it is the "root bookmark", and it does not have a parent bookmark. In this case, this function will return a bookmark object which's function FoxitPDFSDKPython2.Bookmark.IsEmpty returns true.
def FoxitPDFSDKPython2.Bookmark.GetStyle | ( | ) |
Get the style.
If current bookmark is returned by function FoxitPDFSDKPython2.PDFDoc.GetRootBookmark or FoxitPDFSDKPython2.PDFDoc.CreateRootBookmark , that means it is the "root bookmark", and it does not have style information. In this case, this function will return FoxitPDFSDKPython2.Bookmark.e_StyleNormal by default.
def FoxitPDFSDKPython2.Bookmark.GetTitle | ( | ) |
Get the title.
If current bookmark is returned by function FoxitPDFSDKPython2.PDFDoc.GetRootBookmark or FoxitPDFSDKPython2.PDFDoc.CreateRootBookmark , that means it is the "root bookmark", and it does not have title. In this case, this function will return an empty string.
def FoxitPDFSDKPython2.Bookmark.HasChild | ( | ) |
Check if current bookmark has child bookmark(s).
def FoxitPDFSDKPython2.Bookmark.Insert | ( | title, | |
position | |||
) |
Insert a new bookmark according to the relationship position to current bookmark.
For the new bookmark, the color would be 0x000000 and the style would be FoxitPDFSDKPython2.Bookmark.e_StyleNormal by default.
[in] | title | Title string for the new bookmark. It should not be an empty string. |
[in] | position | The position where the new bookmark item is to be inserted, based on current bookmark. Please refer to values starting from FoxitPDFSDKPython2.Bookmark.e_PosFirstChild and this should be one of these values. If current bookmark is just the "root bookmark", parameter position can only be FoxitPDFSDKPython2.Bookmark.e_PosFirstChild or FoxitPDFSDKPython2.Bookmark.e_PosLastChild . |
def FoxitPDFSDKPython2.Bookmark.IsEmpty | ( | ) |
Check whether current object is empty or not.
When the current object is empty, that means current object is useless.
def FoxitPDFSDKPython2.Bookmark.IsFirstChild | ( | ) |
Check if current bookmark is the first child of its parent bookmark.
def FoxitPDFSDKPython2.Bookmark.IsLastChild | ( | ) |
Check if current bookmark is the last child of its parent bookmark.
def FoxitPDFSDKPython2.Bookmark.IsRoot | ( | ) |
Check if current bookmark is the root bookmark.
"root bookmark" is an abstract object. It represents the "Outline" of PDF document. For more details about "Outline", please refer to Section 8.2.3 in PDF Reference 1.7. "root bookmark" can only have some child bookmarks, but no parent, 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.
def FoxitPDFSDKPython2.Bookmark.MoveTo | ( | dest_bookmark, | |
position | |||
) |
Move current bookmark to be child or sibling of another bookmark.
If current bookmark is returned by function FoxitPDFSDKPython2.PDFDoc.GetRootBookmark or FoxitPDFSDKPython2.PDFDoc.CreateRootBookmark , that means it is the "root bookmark", and it cannot be moved to be child or sibling of any bookmark in the bookmark tree. In this case, this function will return false directly.
[in] | dest_bookmark | The destination bookmark. It should not be current bookmark itself or any descendant of current bookmark. Current bookmark will be moved to be child or sibling of the destination bookmark. |
[in] | position | The position where the current bookmark is to be moved to, based on parameter destBookmark. Please refer to values starting from FoxitPDFSDKPython2.Bookmark.e_PosFirstChild and this should be one of these values. |
def FoxitPDFSDKPython2.Bookmark.RemoveAction | ( | ) |
Remove action.
When removing bookmark's action, bookmark's destination will be removed at the same time.
If current bookmark is returned by function FoxitPDFSDKPython2.PDFDoc.GetRootBookmark or FoxitPDFSDKPython2.PDFDoc.CreateRootBookmark , that means it is the "root bookmark", and it does not have any action information. In this case, this function will return true directly.
def FoxitPDFSDKPython2.Bookmark.SetAction | ( | action | ) |
Set action.
If current bookmark is returned by function FoxitPDFSDKPython2.PDFDoc.GetRootBookmark or FoxitPDFSDKPython2.PDFDoc.CreateRootBookmark , that means it is the "root bookmark", and it does not have any action information. In this case, this function will return directly without doing anything.
[in] | action | A valid action to be set. Currently only support following types as the new action: FoxitPDFSDKPython2.Action.e_TypeGoto , FoxitPDFSDKPython2.Action.e_TypeURI , FoxitPDFSDKPython2.Action.e_TypeJavaScript , FoxitPDFSDKPython2.Action.e_TypeNamed , FoxitPDFSDKPython2.Action.e_TypeGoToR , FoxitPDFSDKPython2.Action.e_TypeGoToE , FoxitPDFSDKPython2.Action.e_TypeSubmitForm , FoxitPDFSDKPython2.Action.e_TypeResetForm , FoxitPDFSDKPython2.Action.e_TypeHide , FoxitPDFSDKPython2.Action.e_TypeLaunch , FoxitPDFSDKPython2.Action.e_TypeImportData , FoxitPDFSDKPython2.Action.e_TypeRendition . |
def FoxitPDFSDKPython2.Bookmark.SetColor | ( | color | ) |
Set the color used for displaying title.
If current bookmark is returned by function FoxitPDFSDKPython2.PDFDoc.GetRootBookmark or FoxitPDFSDKPython2.PDFDoc.CreateRootBookmark , that means it is the "root bookmark", and it does not have color. In this case, this function will return directly without doing anything.
[in] | color | New color used for displaying title. Format:0xRRGGBB. |
def FoxitPDFSDKPython2.Bookmark.SetDestination | ( | destination | ) |
Set the destination.
Bookmark's destination is some place in current document where the bookmark can "goto".
If current bookmark is returned by function FoxitPDFSDKPython2.PDFDoc.GetRootBookmark or FoxitPDFSDKPython2.PDFDoc.CreateRootBookmark , that means it is the "root bookmark", and it does not have any destination information. In this case, this function will return directly without doing anything.
[in] | destination | A valid destination. |
def FoxitPDFSDKPython2.Bookmark.SetStyle | ( | style | ) |
Set the style.
If current bookmark is returned by function FoxitPDFSDKPython2.PDFDoc.GetRootBookmark or FoxitPDFSDKPython2.PDFDoc.CreateRootBookmark , that means it is the "root bookmark", and it does not have style information. In this case, this function will return directly without doing anything.
[in] | style | New bookmark style. Please refer to values starting from FoxitPDFSDKPython2.Bookmark.e_StyleNormal and this can be one or a combination of these values. If the style is invalid, FoxitPDFSDKPython2.Bookmark.e_StyleNormal will be set by default. |
def FoxitPDFSDKPython2.Bookmark.SetTitle | ( | title | ) |
Set the title.
If current bookmark is returned by function FoxitPDFSDKPython2.PDFDoc.GetRootBookmark or FoxitPDFSDKPython2.PDFDoc.CreateRootBookmark , that means it is the "root bookmark", and it does not have title. In this case, this function will return directly without doing anything.
[in] | title | New title string. It should not be an empty string. |