GetOutlineLevel
Outlines
Description
Returns the nesting depth of an outline item (bookmark) relative to the document outline root. A bookmark that hangs directly off the root reports level 1, its children level 2, and so on through the hierarchy
Syntax
Delphi
Function TPDFlib.GetOutlineLevel(OutlineID: Integer): Integer;
Parameters
| OutlineID | The ID of the outline as returned by the NewOutline function. Alternatively, use the GetOutlineID function to get a valid outline ID |
|---|
Return values
| >= 1 | The depth of the bookmark below the outline root, where 1 denotes a top-level bookmark |
|---|---|
| 0 | OutlineID is not a valid outline handle, or no document is loaded |
Remarks
The level is computed by walking the /Parent chain from the bookmark up to the outline root. Use GetOutlineIsOpen to check whether the bookmark is expanded in a viewer
See also
GetOutlineIsOpen, GetOutlineID, NewOutline, GetOutlineObjectNumber