PDFsharp-net6

PdfOutlineCollection

Namespace: PdfSharp.Pdf

Represents a collection of outlines.

public class PdfOutlineCollection : PdfObject, System.ICloneable, System.Collections.Generic.ICollection`1[[PdfSharp.Pdf.PdfOutline, PdfSharp, Version=0.1.3.0, Culture=neutral, PublicKeyToken=null]], System.Collections.Generic.IEnumerable`1[[PdfSharp.Pdf.PdfOutline, PdfSharp, Version=0.1.3.0, Culture=neutral, PublicKeyToken=null]], System.Collections.IEnumerable, System.Collections.Generic.IList`1[[PdfSharp.Pdf.PdfOutline, PdfSharp, Version=0.1.3.0, Culture=neutral, PublicKeyToken=null]]

Inheritance ObjectPdfItemPdfObjectPdfOutlineCollection
Implements ICloneable, ICollection<PdfOutline>, IEnumerable<PdfOutline>, IEnumerable, IList<PdfOutline>

Properties

HasOutline

Caution

Use ‘Count > 0’ - HasOutline will throw exception.


Indicates whether the outline collection has at least one entry.

public bool HasOutline { get; }

Property Value

Boolean

Count

Gets the number of entries in this collection.

public int Count { get; }

Property Value

Int32

IsReadOnly

Returns false.

public bool IsReadOnly { get; }

Property Value

Boolean

Item

public PdfOutline Item { get; set; }

Property Value

PdfOutline

Owner

Gets the PdfDocument this object belongs to.

public PdfDocument Owner { get; }

Property Value

PdfDocument

IsIndirect

Indicates whether the object is an indirect object.

public bool IsIndirect { get; }

Property Value

Boolean

Internals

Gets the PdfInternals object of this document, that grants access to some internal structures which are not part of the public interface of PdfDocument.

public PdfObjectInternals Internals { get; }

Property Value

PdfObjectInternals

Reference

Gets the indirect reference of this object. If the value is null, this object is a direct object.

public PdfReference Reference { get; internal set; }

Property Value

PdfReference

ReferenceNotNull

Gets the indirect reference of this object. Throws if it is null.

public PdfReference ReferenceNotNull { get; }

Property Value

PdfReference

Exceptions

InvalidOperationException
The indirect reference must be not null here.

Methods

Remove(PdfOutline)

Removes the first occurrence of a specific item from the collection.

public bool Remove(PdfOutline item)

Parameters

item PdfOutline

Returns

Boolean

Add(PdfOutline)

Adds the specified outline.

public void Add(PdfOutline outline)

Parameters

outline PdfOutline

Clear()

Removes all elements form the collection.

public void Clear()

Contains(PdfOutline)

Determines whether the specified element is in the collection.

public bool Contains(PdfOutline item)

Parameters

item PdfOutline

Returns

Boolean

CopyTo(PdfOutline[], Int32)

Copies the collection to an array, starting at the specified index of the target array.

public void CopyTo(PdfOutline[] array, int arrayIndex)

Parameters

array PdfOutline[]

arrayIndex Int32

Add(String, PdfPage, Boolean, PdfOutlineStyle, XColor)

Adds the specified outline entry.

public PdfOutline Add(string title, PdfPage destinationPage, bool opened, PdfOutlineStyle style, XColor textColor)

Parameters

title String
The outline text.

destinationPage PdfPage
The destination page.

opened Boolean
Specifies whether the node is displayed expanded (opened) or collapsed.

style PdfOutlineStyle
The font style used to draw the outline text.

textColor XColor
The color used to draw the outline text.

Returns

PdfOutline

Add(String, PdfPage, Boolean, PdfOutlineStyle)

Adds the specified outline entry.

public PdfOutline Add(string title, PdfPage destinationPage, bool opened, PdfOutlineStyle style)

Parameters

title String
The outline text.

destinationPage PdfPage
The destination page.

opened Boolean
Specifies whether the node is displayed expanded (opened) or collapsed.

style PdfOutlineStyle
The font style used to draw the outline text.

Returns

PdfOutline

Add(String, PdfPage, Boolean)

Adds the specified outline entry.

public PdfOutline Add(string title, PdfPage destinationPage, bool opened)

Parameters

title String
The outline text.

destinationPage PdfPage
The destination page.

opened Boolean
Specifies whether the node is displayed expanded (opened) or collapsed.

Returns

PdfOutline

Add(String, PdfPage)

Creates a PdfOutline and adds it into the outline collection.

public PdfOutline Add(string title, PdfPage destinationPage)

Parameters

title String

destinationPage PdfPage

Returns

PdfOutline

IndexOf(PdfOutline)

Gets the index of the specified item.

public int IndexOf(PdfOutline item)

Parameters

item PdfOutline

Returns

Int32

Insert(Int32, PdfOutline)

Inserts the item at the specified index.

public void Insert(int index, PdfOutline outline)

Parameters

index Int32

outline PdfOutline

RemoveAt(Int32)

Removes the outline item at the specified index.

public void RemoveAt(int index)

Parameters

index Int32

GetEnumerator()

Returns an enumerator that iterates through the outline collection.

public IEnumerator<PdfOutline> GetEnumerator()

Returns

IEnumerator<PdfOutline>

CountOpen()

internal int CountOpen()

Returns

Int32