PdfOutline Object

Overview

PdfOutline is a collection of PdfOutlineItem objects representing a hierarchy of outlines (bookmarks). The PdfOutline collection is obtainable via PdfDocument's Outline property. For more information on outlines, see Section 10.2 - Outlines.

Member List

Properties


Count As Long (Read-only)
Returns the number of PdfOutlineItem objects in this collection.

Item( Index As Long ) As PdfOutlineItem (Read-only)
This is the default parameterized property returning a PdfOutlineItem specified by a 1-based Index.

Methods


Function Add(Title As String, Dest as PdDest, Parent As PdfOutlineItem, InsertBefore As PdfOutlineItem, Optional Param) As PdfOutlineItem

Adds a new outline item (bookmark) to the outline hierarchy. Returns an instance of the PdfOutlineItem object representing the newly added item.

Title specifies the text associated with the bookmark.

Dest specifies a destination associated with the bookmark. Can be set to Nothing. A bookmark can alternatively be associated with an action.

Parent specifies the parent outline item for this bookmark. The newly added item will be added underneath the parent item. Can be set to Nothing if this is a top-level item.

InsertBefore specifies where this item is to be placed among its siblings in the hierarchy. InsertBefore's parent must be the same as this item's parent. The new item will be inserted right before the InsertBefore item.

Param is a PdfParam object or parameter string specifying various appearance parameters of the newly added item, including:

  • Bold: if set to True, the item's text appears in bold. False by default.
  • Italic: if set to True, the item's text appears in italic. False by default.
  • Expanded: if set to False, the item will initially appear collapsed (closed). True by default.
  • Color: specifies the item's color by name or hex number. Black by default.
  • R, G, B: an alternative way to specify the item's color

For more information on this method, see Section 10.2 - Outlines.


Sub Clear()
Removes all outline items from this collection.