Skip to content

IGR_Get_Bookmark_Root

IGR_Get_Bookmark_Root provides access to the top-level root node of the bookmark hierarchy.

Prototype

IGR_LONG IGR_Get_Bookmark_Root(
    IGR_LONG DocHandle,
    IGR_Bookmark *Dest,
    Error_Control_Block* Error);

Parameters

DocHandle: IGR_LONG

Handle to a document, opened by a call to IGR_Open_File, IGR_Open_File_Ex, IGR_Open_Stream or IGR_Open_Stream_Ex.

Dest: Pointer to IGR_Bookmark

Pointer to a user-supplied IGR_Bookmark that will be populated enabling supplementary calls to bookmark methods.

Error: Pointer to Error_Control_Block

Returns error details if the call fails.

Return value

Success: IGR_LONG

Returns IGR_OK.

Failure: IGR_LONG

Returns one of the possible IGR_E error codes.

Sample code

Error_Control_Block Err;
IGR_LONG Capabilities, DocType, DocHandle, PageCount;
HPAGE PageHandle;

IGR_LONG RC = IGR_Open_Stream(pStream, IGR_FORMAT_IMAGE, &Capabilities, &DocType, &DocHandle, &Err);
if (RC == IGR_OK)
{
    IGR_Bookmark Bookmarks, Child;
    if (IGR_Get_Bookmark_Root(DocHandle, &Bookmarks, &Err) == IGR_OK
        && IGR_Get_Bookmark_First_Child(DocHandle, &Bookmarks, &Child, &Err) == IGR_OK)
    {
        do
        {
            // …
        } while (IGR_Get_Bookmark_Next_Sibling(DocHandle, &Child, &Child, &Err)==IGR_OK);
    }
    IGR_Close_File(DocHandle, &ISYSError);
}

See also