ArkoPDF
← SDK API 參考

ipdf_bookmark.h

书签:书签树的读取与维护。

介面說明保留標頭檔裡的英文原文 —— 照文件寫程式時要能一眼對上程式碼裡的註解。

常數

簽章ValueDescription
PDF_BOOKMARK_ITALIC1Italic style of bookmark item.
PDF_BOOKMARK_BOLD2Bold style of bookmark item.

class IPDF_Bookmark

PDF bookmark(outline item) interface.

方法(11)

簽章說明
Release()Release a bookmark object.
GetTitle()Get the title. A unicode encoded string is returned.
GetTitleUTF8()Get the title. A utf8 encoded string is returned.
SetTitle(const wchar_t* title)Set the title of a bookmark item.
SetTitle(const char* title_utf8)Set the title of a bookmark item.
GetColor()Get the color. In Windows COLORREF format: 0x00ggbbrr.
SetColor(unsigned int color)Set the color of a bookmark item.
GetFontStyle()Get the font style. Italic and/or bold.
SetFontStyle(int style)Set the fontstyle of a bookmark item.
GetDestInfo(PDSDK_Dest* dest, IPDF_Document* sdk_doc)Get the destination of a bookmark item.
SetDestInfo(const PDSDK_Dest* dest, IPDF_Document* sdk_doc)Set the destination of a bookmark item.
SetTitle
void SetTitle(const wchar_t* title) = 0;

Set the title of a bookmark item.

參數

  • title(in) — The new title(unicode) of the bookmark item.
SetTitle
void SetTitle(const char* title_utf8) = 0;

Set the title of a bookmark item.

參數

  • title(in) — The new title (utf8) of the bookmark item.
SetColor
void SetColor(unsigned int color) = 0;

Set the color of a bookmark item.

參數

  • color(in) — The new color of the bookmark item.
SetFontStyle
void SetFontStyle(int style) = 0;

Set the fontstyle of a bookmark item.

參數

  • color(in) — The new fontstyle of the bookmark item. Italic and/or bold. See PDF ref 8.2.2 for the details
GetDestInfo
void GetDestInfo(PDSDK_Dest* dest, IPDF_Document* sdk_doc) = 0;

Get the destination of a bookmark item.

參數

  • dest(out) — Receiv the destination information.
  • sdk_doc(in) — The PDF document.
SetDestInfo
void SetDestInfo(const PDSDK_Dest* dest, IPDF_Document* sdk_doc) = 0;

Set the destination of a bookmark item.

參數

  • dest(in) — The new destination.
  • sdk_doc(in) — The PDF document. NOTE: If the bookmark has action, the action will be removed.

class IPDF_BookmarkTree

PDF bookmark(outline) tree interface.

方法(7)

簽章說明
Release()Release a bookmark tree object.
GetFirstChild(const IPDF_Bookmark* parent)Get the first child bookmark of specified parent bookmark.
GetNextSibling(const IPDF_Bookmark* bookmark)Get the next sibling bookmark of specified bookmark in the same level.
InsertBookmark(const wchar_t* title, IPDF_Bookmark* parent, IPDF_Bookmark* …)New a bookmark item and insert into bookmark tree.
InsertBookmark(const char* title_utf8, IPDF_Bookmark* parent, IPDF_Bookmark…)New a bookmark item and insert into bookmark tree.
MoveBookmark(IPDF_Bookmark* bookmark, IPDF_Bookmark* parent_moveto, IPDF_…)Move a bookmark item to specified level.
RemoveBookmark(IPDF_Bookmark* bookmark)Remove a bookmark item from bookmark tree.
GetFirstChild
IPDF_Bookmark* GetFirstChild(const IPDF_Bookmark* parent) = 0;

Get the first child bookmark of specified parent bookmark.

參數

  • parent(in) — The input parent bookmark.

傳回值:The first child bookmark.

GetNextSibling
IPDF_Bookmark* GetNextSibling(const IPDF_Bookmark* bookmark) = 0;

Get the next sibling bookmark of specified bookmark in the same level.

參數

  • bookmark(in) — The input bookmark.

傳回值:The next sibling bookmark.

InsertBookmark
IPDF_Bookmark* InsertBookmark(const wchar_t* title, IPDF_Bookmark* parent, IPDF_Bookmark* insert_after) = 0;

New a bookmark item and insert into bookmark tree.

參數

  • title(in) — The unicode title of new bookmark.
  • parent(in) — The parent of new bookmark. Can be 0, if insert_after not NULL or it will be the first item of the tree.
  • insert_after(in) — The item after which the new item is to be inserted. If 0, will be inserted to the first child of parent.

傳回值:The new item if successful; otherwise 0.

InsertBookmark
IPDF_Bookmark* InsertBookmark(const char* title_utf8, IPDF_Bookmark* parent, IPDF_Bookmark* insert_after) = 0;

New a bookmark item and insert into bookmark tree.

參數

  • title(in) — The utf8 title of new bookmark.
  • parent(in) — The parent of new bookmark. Can be 0, if insert_after not NULL or it will be the first item of the tree.
  • insert_after(in) — The item after which the new item is to be inserted. If 0, will be inserted to the first child of parent.

傳回值:The new item if successful; otherwise 0.

MoveBookmark
int MoveBookmark(IPDF_Bookmark* bookmark, IPDF_Bookmark* parent_moveto, IPDF_Bookmark* insert_after) = 0;

Move a bookmark item to specified level.

參數

  • bookmark(in) — The bookmark to be moved.
  • parent_moveto(in) — The destinate parent which to be inserting.
  • insert_after(in) — The item after which the moving item is to be inserted. If 0, will be inserted to the first child of parent.

傳回值:1 if successful; otherwise 0.

RemoveBookmark
void RemoveBookmark(IPDF_Bookmark* bookmark) = 0;

Remove a bookmark item from bookmark tree.

參數

  • bookmark(in) — The bookmark item to be removed.