Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

DynaPDF Manual - Page 475

Previous Page 474   Index   Next Page 476

Function Reference
Page 475 of 750
InsertBookmark
Syntax:
SI32 pdfInsertBookmark(
const PPDF* IPDF,
// Instance pointer
const char* Title, // Bookmark title
SI32 Parent,
// Immediate parent bookmark
UI32 DestPage,
// Destination page that should be opened
LBOOL Open,
// Open or close the node when it contains children
LBOOL AddChildren) // Add all bookmarks below the new one as children
The function inserts a bookmark in an existing outline tree. It sets also the page mode to
pmUseOutline (see SetPageMode()). If the outline tree should not be shown when opening the
document then set the page mode back to pmUseNone or another value before closing the
document.
Parent can be the handle of the parent bookmark after the new bookmark should be inserted or -1. If
Parent is set to -1 the bookmark is inserted as the first root node in the outline tree.
If the parameter AddChildren is set to true, the bookmarks below the new one are added as children
to the new bookmark. This can be useful when merging PDF files and if the bookmarks from each
PDF file should be separated.
Notice:
When inserting a bookmark the handles of all bookmarks below the new one are incremented by
one.
Remarks:
This function is implemented in an Ansi and Unicode compatible version. The Ansi Version
supports Ansi strings of the code page 1252 only. To create a bookmark in an arbitrary encoding
convert the string to Unicode with the function ConvToIncode() and use the Unicode version to
create the bookmark.
Return values:
If the function succeeds the return value is the bookmark handle, a value greater or equal zero. If the
function fails the return value is a negative error code.
InsertBookmarkEx
Syntax:
SI32 pdfInsertBookmarkEx(
const PPDF* IPDF,
// Instance pointer
const char* Title, // Bookmark title
SI32 Parent,
// Immediate parent bookmark
UI32 NamedDest,
// Named Destination handle
LBOOL Open,
// Open or close the node when it contains children
LBOOL AddChildren) // Add all bookmarks below the new one as children
 

Previous topic: InsertBMPFromHandle

Next topic: InsertImage (obsolete)