PdfOutlineCollection Class
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.
[ComVisible(false)]
public sealed class PdfOutlineCollection : PdfCollection<PdfOutline>, IList, ICollection, IList<PdfOutline>, ICollection<PdfOutline>, IEnumerable<PdfOutline>, IEnumerable
<ComVisible(False)>
Inherits PdfCollection(Of PdfOutline)
Implements IList, ICollection, IList(Of PdfOutline), ICollection(Of PdfOutline), IEnumerable(Of PdfOutline), IEnumerable
- Inheritance:
- System.ObjectPdfOutlineCollection
Implements
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.
Property Value
The first of this item’s immediate children in the outline hierarchy.
See Also
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.
Property Value
The last of this item’s immediate children in the outline hierarchy.
See Also
Methods
AddAfter(PdfOutline, PdfOutline)
Adds the specified new PdfOutline after the specified existing PdfOutline in the PdfOutlineCollection.
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.
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
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.
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.
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
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.
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.
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
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.
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.
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
The new PdfOutline with the specified title.
Exceptions
- System.ArgumentNullException
title
is null.
GetEnumerator()
Returns an enumerator that iterates through the PdfOutlineCollection.
public PdfOutlineCollection.Enumerator GetEnumerator()
Public Function GetEnumerator As PdfOutlineCollection.Enumerator
Returns
RemoveFirst()
Removes the PdfOutline at the start of the PdfOutlineCollection.
Exceptions
- System.InvalidOperationException
The PdfOutlineCollection is empty.
RemoveLast()
Removes the PdfOutline at the end of the PdfOutlineCollection.
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) |