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

DynaPDF Manual - Page 332

Previous Page 331   Index   Next Page 333

Function Reference
Page 332 of 750
GetBookmark
Syntax:
LBOOL pdfGetBookmark(
const PPDF* IPDF,
// Instance pointer
SI32 AHandle,
// Bookmark handle
struct TBookmark ADDR Bmk) // see below
struct TBookmark
{
UI32 Color;
// Bookmark color (PDF 1.4)
SI32 DestPage;
// Destination page
struct TPDFRect DestPos; // Destination position
TDestType DestType;
// Destination type (see SetBookmarkDest())
LBOOL Open;
// True if the bookmark appears open
SI32 Parent;
// Parent bookmark if any or -1
TBmkStyle Style;
// Text style, see below (PDF 1.4)
const void* Title;
// Pointer to text string
UI32 TitleLen;
// Title length in characters
LBOOL Unicode;
// If true, Title is a pointer to UI16*
};
typedef enum
{
bmsNormal = 0,
bmsItalic = 1,
bmsBold
= 2
}TBmkStyle;
This function returns the properties of a bookmark. The parameter Bmk is required it must not be
NULL. The parameter style is a bitmask, maybe more than one constant is set at time, i.e. bmsBold
and bmsItalic. Title is either a pointer to an Ansi or Unicode string depending on whether Unicode is
true or false. Make a typecast to UI16* if Title is in Unicode format. The parameter TitleLen is the
string length in characters excluding the null-terminator. The destination type are described in detail
at SetBookmarkDest().
Remarks:
The parameter Title is a pointer to the original string. This value must not be changed or freed.
Delphi users must explicitely cast the string to PAnsiChar or PWideChar depending on the
parameter Unicode. For example, String(bmk.Title) causes a buffer overrun because Delphi tries to
identify the string format in this case. The correct syntax is either String(PAnsiChar(bmk.Title)) or
String(PWideChar(bmk.Title)) depending on whether Unicode is true or false.
Return values:
If the function succeeds the return value is 1 and the structure Bmk is filled with values. If the
function fails the return value is 0.
 

Previous topic: GetBidiMode

Next topic: GetBuffer