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

DynaPDF Manual - Page 113

Previous Page 112   Index   Next Page 114

Function Reference
Page 113 of 750
AddBookmarkEx2
Syntax:
SI32 pdfAddBookmarkEx2(
const PPDF* IPDF,
// Instance pointer
const char* Title,
// Title of the bookmark
SI32 Parent,
// Parent bookmark if any or -1 for a root node
const void* NamedDest, // Name of a named destination
LBOOL Unicode,
// NamedDest is an Unicode String?
LBOOL Open)
// Open or close the node when it has children?
This function adds a bookmark to the global outline tree of the document. It sets also the page mode
to pmUseOutlines (see SetPageMode()). If the outline tree should not be shown when opening the
document, set the page mode back to pmUseNone or any other value before closing the document.
Parent can be a handle of another bookmark if it should be added as a child of this bookmark. If
Parent is set to -1 the bookmark is added as a root node.
The difference in comparison to AddBookmarkEx is that the named destination can be defined as a
string. This makes it possible to create the bookmark, also if you don't have the required information
to create the named destination at this point. If the named destination does not exist when the file is
closed then the bookmark does nothing. See also CreateNamedDest().
The parameter Unicode specifies whether the parameter NamedDest is an Ansi or Unicode string
(UTF-16). Note that the usage of Unicode is not recommended since named destinations are treated
as binary strings.
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 handle of the bookmark, a value greater or equal zero.
If the function fails the return value is a negative error code.
 

Previous topic: AddBookmarkEx

Next topic: AddButtonImage