TPDFlibOutlineViewer

Viewer

Description

TPDFlibOutlineViewer (unit Lib\PDFlibViewer.pas, added in v3.126.0) is a bookmark panel for TPDFlibViewer. It lists the document's outline tree with indentation, and clicking a bookmark navigates the attached viewer to the bookmark's destination page

Syntax

Delphi

TPDFlibOutlineViewer = Class(TPDFlibViewerPanel)
  Public
    Function ItemOutlineID(Index: Integer): Integer;
    Function ItemHasChildren(Index: Integer): Boolean;
    Function IsOutlineExpanded(OutlineID: Integer): Boolean;
    Procedure SetOutlineExpanded(OutlineID: Integer; Expanded: Boolean);
    Function ToggleOutlineExpanded(OutlineID: Integer): Boolean;
    Procedure ExpandAll;
    Procedure CollapseAll;
  End;

Key members

ItemOutlineIDOutline node identifier behind the 0-based row, for use with the outline functions of the attached library
ItemHasChildrenTrue when the row's outline node carries child bookmarks
IsOutlineExpandedExpansion state of one outline node
SetOutlineExpandedExpands or collapses one outline node and refreshes the rows
ToggleOutlineExpandedFlips the expansion state of one outline node; True when the node was expanded by the call
ExpandAllExpands every outline node and lists the whole tree
CollapseAllCollapses the tree back to the top-level bookmarks

Remarks

The panel rebuilds its rows automatically when a document opens in the attached viewer, mirroring the outline hierarchy through indentation; subtrees load on demand as bookmarks are expanded. Bookmarks without a destination are listed but do not navigate. Combine it with TPDFlibSearchPanel and TPDFlibThumbnailBar to assemble a classic reader sidebar

See also

TPDFlibViewerPanel, TPDFlibViewer, TPDFlibSearchPanel, TPDFlibThumbnailBar