PDFix SDK  7.2.0
Loading...
Searching...
No Matches
PdfBookmark Struct Referenceabstract

PdfBookmark class. More...

#include <pdfix.h>

Public Member Functions

virtual int GetTitle (wchar_t *buffer, int len) const =0
 Gets a bookmark's title. More...
 
virtual void SetTitle (const wchar_t *title)=0
 Sets a bookmark's title. More...
 
virtual bool GetAppearance (PdfBookmarkAppearance *appearance)=0
 Gets a bookmark's appearance. More...
 
virtual bool SetAppearance (const PdfBookmarkAppearance *appearance)=0
 Sets a bookmarks's appearance. More...
 
virtual PdfActionGetAction ()=0
 Gets a bookmark's action object. More...
 
virtual bool SetAction (PdfAction *action)=0
 
virtual int GetNumChildren ()=0
 Gets the number of child bookmark in a parent bookmark object. More...
 
virtual PdfBookmarkGetChild (int index)=0
 Gets the requested child bookmark from a parent bookmark. More...
 
virtual PdfBookmarkGetParent ()=0
 
virtual PdfBookmarkGetNext ()=0
 
virtual PdfBookmarkGetPrev ()=0
 
virtual PdsDictionaryGetObject ()=0
 Gets the object of the bookmark. More...
 
virtual bool AddChild (int index, PdfBookmark *bmk)=0
 Adds a new bookmark to the tree as the new last child of the bookmark. More...
 
virtual PdfBookmarkAddNewChild (int index, const wchar_t *title)=0
 Adds a new bookmark to the tree as the new last child of the bookmark. More...
 
virtual bool IsValid () const =0
 
virtual PdfBookmarkRemoveChild (int index)=0
 Removes the specified child froma an action. More...
 
virtual bool IsOpen () const =0
 Tests whether an bookmark is open. More...
 
virtual bool SetOpen (bool open)=0
 Open or close bookmark to show or hide its children. More...
 

Detailed Description

PdfBookmark class.

A bookmark corresponds to an outline object in a PDF document. A document outline allows the user to navigate interactively from one part of the document to another. An outline consists of a tree-structured hierarchy of bookmarks, which display the document's structure to the user. Each bookmark has: A title that appears on screen. An action that specifies what happens when the user clicks on the bookmark.

Member Function Documentation

◆ AddChild()

virtual bool PdfBookmark::AddChild ( int  index,
PdfBookmark bmk 
)
pure virtual

Adds a new bookmark to the tree as the new last child of the bookmark.

Parameters
indexwhere to create the new bookmark child Passing a value of kInsertAfterLast adds the bookmark to the end of the array. Passing a value of kInsertBeforeFirst adds the bookmark to the beginning of the array.
titleThe new bookmark's title.
Returns
bookmark if it was added, null otherwise.

◆ AddNewChild()

virtual PdfBookmark * PdfBookmark::AddNewChild ( int  index,
const wchar_t *  title 
)
pure virtual

Adds a new bookmark to the tree as the new last child of the bookmark.

Parameters
indexwhere to create the new bookmark child Passing a value of kInsertAfterLast adds the bookmark to the end of the array. Passing a value of kInsertBeforeFirst adds the bookmark to the beginning of the array.
titleThe new bookmark's title.
Returns
bookmark if it was added, null otherwise.

◆ GetAction()

virtual PdfAction * PdfBookmark::GetAction ( )
pure virtual

Gets a bookmark's action object.

Returns
The bookmark's action object or nullptr if bookmark does not have an action.

◆ GetAppearance()

virtual bool PdfBookmark::GetAppearance ( PdfBookmarkAppearance appearance)
pure virtual

Gets a bookmark's appearance.

Parameters
appearance(filled by method) Pointer to a PdfBookmarkAppearance structure.
Returns
true if the appearance was successfully retrieved. false otherwise

◆ GetChild()

virtual PdfBookmark * PdfBookmark::GetChild ( int  index)
pure virtual

Gets the requested child bookmark from a parent bookmark.

Parameters
indexThe index of bookmark object to obtain.
Returns
Requested bookmark.
See also
PdfBookmark::GetNumChildren

◆ GetNext()

virtual PdfBookmark * PdfBookmark::GetNext ( )
pure virtual

Gets a bookmark's next bookmark object. NOTE: If the bookmark is root, it doesn't have next object.

Returns
Next bookmark object, or null if is the root bookmark of a document.

◆ GetNumChildren()

virtual int PdfBookmark::GetNumChildren ( )
pure virtual

Gets the number of child bookmark in a parent bookmark object.

Returns
The number of children.
See also
PdfBookmark::GetChild

◆ GetObject()

virtual PdsDictionary * PdfBookmark::GetObject ( )
pure virtual

Gets the object of the bookmark.

Returns
The PdsDictionary of the bookmark.

◆ GetParent()

virtual PdfBookmark * PdfBookmark::GetParent ( )
pure virtual

Gets a bookmark's parent bookmark. NOTE: If parent is null, call only PdfBookmark::GetNumChildren and PdfBookmark::GetChild methods. Other methods return false.

Returns
Parent bookmark, or null if is the root bookmark of a document.

◆ GetPrev()

virtual PdfBookmark * PdfBookmark::GetPrev ( )
pure virtual

Gets a bookmark's previous bookmark object. NOTE: If the bookmark is root, it doesn't have prev object.

Returns
Previous bookmark object, or null if is the root bookmark of a document.

◆ GetTitle()

virtual int PdfBookmark::GetTitle ( wchar_t *  buffer,
int  len 
) const
pure virtual

Gets a bookmark's title.

Parameters
buffer(filled by method) If the buffer is null function returns required length of string
lenLength of a buffer to be filled in.
Returns
Number of characters written into buffer of required length.

◆ IsOpen()

virtual bool PdfBookmark::IsOpen ( ) const
pure virtual

Tests whether an bookmark is open.

Returns
true if an PdfBookmark is open, false otherwise.

◆ IsValid()

virtual bool PdfBookmark::IsValid ( ) const
pure virtual

Tests whether an bookmark is valid. This is intended only to ensure that the bookmark has not been deleted, not to ensure that all necessary information is present and valid.

Returns
true if an PdfBookmark is a valid bookmark object, false otherwise.

◆ RemoveChild()

virtual PdfBookmark * PdfBookmark::RemoveChild ( int  index)
pure virtual

Removes the specified child froma an action.

Parameters
indexThe index of the child.
Returns
The removed bookmark object or null in case of error.

◆ SetAction()

virtual bool PdfBookmark::SetAction ( PdfAction action)
pure virtual

Sets a bookmark's action. NOTE: If param action is null function removes action from bookmark.

Parameters
actionThe bookmark's action.
Returns
true if the action was successfully set, false otherwise.

◆ SetAppearance()

virtual bool PdfBookmark::SetAppearance ( const PdfBookmarkAppearance appearance)
pure virtual

Sets a bookmarks's appearance.

Parameters
appearancePointer to a PdfBookmarkAppearance structure.
Returns
true if the appearance was successfully set, false otherwise

◆ SetOpen()

virtual bool PdfBookmark::SetOpen ( bool  open)
pure virtual

Open or close bookmark to show or hide its children.

Parameters
openThe bookmark state to set.
Returns
true if open state was set, false otherwise.

◆ SetTitle()

virtual void PdfBookmark::SetTitle ( const wchar_t *  title)
pure virtual

Sets a bookmark's title.

Parameters
titleThe new title of the bookmark.