GemBox.Pdf
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    PdfOutlineCollection Class

    Namespace:
    GemBox.Pdf
    Assembly:
    GemBox.Pdf.dll

    A PDF document may contain a document outline that the conforming reader may display on the screen, allowing the user to navigate interactively from one part of the document to another. The outline consists of a tree-structured hierarchy of outline items (sometimes called bookmarks), which serve as a visual table of contents to display the document's structure to the user.

    PdfOutlineCollection represents a collection of outline items.

    note

    This collection is implemented as doubly linked list and therefore methods that use random access (index) are an O(n) operations, where n is Count.

    • C#
    • VB.NET
    [ComVisible(false)]
    public sealed class PdfOutlineCollection : PdfCollection<PdfOutline>, IList, ICollection, IList<PdfOutline>, ICollection<PdfOutline>, IReadOnlyList<PdfOutline>, IReadOnlyCollection<PdfOutline>, IEnumerable<PdfOutline>, IEnumerable
    <ComVisible(False)>
        Inherits PdfCollection(Of PdfOutline)
        Implements IList, ICollection, IList(Of PdfOutline), ICollection(Of PdfOutline), IReadOnlyList(Of PdfOutline), IReadOnlyCollection(Of PdfOutline), IEnumerable(Of PdfOutline), IEnumerable
    Inheritance:
    System.Object
    PdfObject
    PdfCollection
    PdfCollection<PdfOutline>
    PdfOutlineCollection
    Implements
    System.Collections.IList
    System.Collections.ICollection
    System.Collections.Generic.IList<PdfOutline>
    System.Collections.Generic.ICollection<PdfOutline>
    System.Collections.Generic.IReadOnlyList<PdfOutline>
    System.Collections.Generic.IReadOnlyCollection<PdfOutline>
    System.Collections.Generic.IEnumerable<PdfOutline>
    System.Collections.IEnumerable

    Properties

    First

    (Required if the item has any descendants; shall be an indirect reference) The first of this item’s immediate children in the outline hierarchy.

    • C#
    • VB.NET
    public PdfOutline First { get; }
    Public ReadOnly Property First As PdfOutline
    Property Value
    PdfOutline

    The first of this item’s immediate children in the outline hierarchy.

    See Also
    PDF Specification ISO 32000-1:2008, section '12.3.3 Document Outline'

    Last

    (Required if the item has any descendants; shall be an indirect reference) The last of this item’s immediate children in the outline hierarchy.

    • C#
    • VB.NET
    public PdfOutline Last { get; }
    Public ReadOnly Property Last As PdfOutline
    Property Value
    PdfOutline

    The last of this item’s immediate children in the outline hierarchy.

    See Also
    PDF Specification ISO 32000-1:2008, section '12.3.3 Document Outline'

    Methods

    AddAfter(PdfOutline, PdfOutline)

    Adds the specified new PdfOutline after the specified existing PdfOutline in the PdfOutlineCollection.

    • C#
    • VB.NET
    public void AddAfter(PdfOutline outline, PdfOutline newOutline)
    Public Sub AddAfter(outline As PdfOutline, newOutline As PdfOutline)
    Parameters
    outline
    PdfOutline

    The PdfOutline after which to insert newOutline.

    newOutline
    PdfOutline

    The new PdfOutline to add to the PdfOutlineCollection.

    Exceptions
    System.ArgumentNullException

    outline or newOutline is null.

    System.InvalidOperationException

    outline is not in the current PdfOutlineCollection or newOutline belongs to another PdfOutlineCollection.

    AddAfter(PdfOutline, String)

    Adds a new PdfOutline with the specified title after the specified existing PdfOutline in the PdfOutlineCollection.

    • C#
    • VB.NET
    public PdfOutline AddAfter(PdfOutline outline, string title)
    Public Function AddAfter(outline As PdfOutline, title As String) As PdfOutline
    Parameters
    outline
    PdfOutline

    The PdfOutline after which to insert a new PdfOutline with the specified title.

    title
    System.String

    The title of a new PdfOutline added to the PdfOutlineCollection.

    Returns
    PdfOutline

    The new PdfOutline with the specified title.

    Exceptions
    System.ArgumentNullException

    outline or title is null.

    System.InvalidOperationException

    outline is not in the current PdfOutlineCollection.

    AddBefore(PdfOutline, PdfOutline)

    Adds the specified new PdfOutline before the specified existing PdfOutline in the PdfOutlineCollection.

    • C#
    • VB.NET
    public void AddBefore(PdfOutline outline, PdfOutline newOutline)
    Public Sub AddBefore(outline As PdfOutline, newOutline As PdfOutline)
    Parameters
    outline
    PdfOutline

    The PdfOutline before which to insert newOutline.

    newOutline
    PdfOutline

    The new PdfOutline to add to the PdfOutlineCollection.

    Exceptions
    System.ArgumentNullException

    outline or newOutline is null.

    System.InvalidOperationException

    outline is not in the current PdfOutlineCollection or newOutline belongs to another PdfOutlineCollection.

    AddBefore(PdfOutline, String)

    Adds a new PdfOutline with the specified title before the specified existing PdfOutline in the PdfOutlineCollection.

    • C#
    • VB.NET
    public PdfOutline AddBefore(PdfOutline outline, string title)
    Public Function AddBefore(outline As PdfOutline, title As String) As PdfOutline
    Parameters
    outline
    PdfOutline

    The PdfOutline before which to insert a new PdfOutline with the specified title.

    title
    System.String

    The title of a new PdfOutline added to the PdfOutlineCollection.

    Returns
    PdfOutline

    The new PdfOutline with the specified title.

    Exceptions
    System.ArgumentNullException

    outline or title is null.

    System.InvalidOperationException

    outline is not in the current PdfOutlineCollection.

    AddFirst(PdfOutline)

    Adds the specified PdfOutline at the start of the PdfOutlineCollection.

    • C#
    • VB.NET
    public void AddFirst(PdfOutline outline)
    Public Sub AddFirst(outline As PdfOutline)
    Parameters
    outline
    PdfOutline

    The PdfOutline to add at the start of the PdfOutlineCollection.

    Exceptions
    System.ArgumentNullException

    outline is null.

    System.InvalidOperationException

    outline belongs to another PdfOutlineCollection.

    AddFirst(String)

    Adds a new PdfOutline with the specified title at the start of the PdfOutlineCollection.

    • C#
    • VB.NET
    public PdfOutline AddFirst(string title)
    Public Function AddFirst(title As String) As PdfOutline
    Parameters
    title
    System.String

    The title of a new PdfOutline added at the start of the PdfOutlineCollection.

    Returns
    PdfOutline

    The new PdfOutline with the specified title.

    Exceptions
    System.ArgumentNullException

    title is null.

    AddLast(PdfOutline)

    Adds the specified PdfOutline at the end of the PdfOutlineCollection.

    • C#
    • VB.NET
    public void AddLast(PdfOutline outline)
    Public Sub AddLast(outline As PdfOutline)
    Parameters
    outline
    PdfOutline

    The PdfOutline to add at the end of the PdfOutlineCollection.

    Exceptions
    System.ArgumentNullException

    outline is null.

    System.InvalidOperationException

    outline belongs to another PdfOutlineCollection.

    AddLast(String)

    Adds a new PdfOutline with the specified title at the end of the PdfOutlineCollection.

    • C#
    • VB.NET
    public PdfOutline AddLast(string title)
    Public Function AddLast(title As String) As PdfOutline
    Parameters
    title
    System.String

    The title of a new PdfOutline added at the end of the PdfOutlineCollection.

    Returns
    PdfOutline

    The new PdfOutline with the specified title.

    Exceptions
    System.ArgumentNullException

    title is null.

    GetEnumerator()

    Returns an enumerator that iterates through the PdfOutlineCollection.

    • C#
    • VB.NET
    public PdfOutlineCollection.Enumerator GetEnumerator()
    Public Function GetEnumerator As PdfOutlineCollection.Enumerator
    Returns
    PdfOutlineCollection.Enumerator

    A PdfOutlineCollection.Enumerator for the PdfOutlineCollection.

    RemoveFirst()

    Removes the PdfOutline at the start of the PdfOutlineCollection.

    • C#
    • VB.NET
    public void RemoveFirst()
    Public Sub RemoveFirst
    Exceptions
    System.InvalidOperationException

    The PdfOutlineCollection is empty.

    RemoveLast()

    Removes the PdfOutline at the end of the PdfOutlineCollection.

    • C#
    • VB.NET
    public void RemoveLast()
    Public Sub RemoveLast
    Exceptions
    System.InvalidOperationException

    The PdfOutlineCollection is empty.

    Inherited Properties

    Count

    Gets the number of elements contained in the PdfCollection.

    (Inherited from PdfCollection)

    Metadata

    (Optional; PDF 1.4) A metadata stream containing metadata for the component.

    (Inherited from PdfObject)

    Inherited Methods

    Clear()

    Removes all elements from the PdfCollection.

    (Inherited from PdfCollection)

    RemoveAt(System.Int32)

    Removes the element at the specified index of the PdfCollection.

    (Inherited from PdfCollection)

    Implements

    System.Collections.IList
    System.Collections.ICollection
    System.Collections.Generic.IList<T>
    System.Collections.Generic.ICollection<T>
    System.Collections.Generic.IReadOnlyList<T>
    System.Collections.Generic.IReadOnlyCollection<T>
    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable

    Extension Methods

    PdfObjectExtensions.GetDictionary(PdfObject)
    PdfObjectExtensions.GetOrAddDictionary(PdfObject)
    PdfObjectExtensions.GetArray(PdfObject)
    PdfObjectExtensions.GetArray(PdfCollection)
    PdfObjectExtensions.GetOrAddArray(PdfCollection)

    Examples

    Outlines example

    See Also

    PDF Specification ISO 32000-1:2008, section '12.3.3 Document Outline'
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.