PDFsharp-net6

PdfOutline

Namespace: PdfSharp.Pdf

Represents an outline item in the outlines tree. An ‘outline’ is also known as a ‘bookmark’.

public sealed class PdfOutline : PdfDictionary, System.ICloneable, System.Collections.Generic.IEnumerable`1[[System.Collections.Generic.KeyValuePair`2[[System.String, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[PdfSharp.Pdf.PdfItem, PdfSharp, Version=0.1.3.0, Culture=neutral, PublicKeyToken=null]], System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Collections.IEnumerable

Inheritance ObjectPdfItemPdfObjectPdfDictionaryPdfOutline
Implements ICloneable, IEnumerable<KeyValuePair<String, PdfItem>>, IEnumerable

Properties

Parent

Gets the parent of this outline item. The root item has no parent and returns null.

public PdfOutline Parent { get; internal set; }

Property Value

PdfOutline

Title

Gets or sets the title.

public string Title { get; set; }

Property Value

String

DestinationPage

Gets or sets the destination page.

public PdfPage DestinationPage { get; set; }

Property Value

PdfPage

Left

Gets or sets the left position of the page positioned at the left side of the window. Applies only if PageDestinationType is Xyz, FitV, FitR, or FitBV.

public Nullable<double> Left { get; set; }

Property Value

Nullable<Double>

Top

Gets or sets the top position of the page positioned at the top side of the window. Applies only if PageDestinationType is Xyz, FitH, FitR, ob FitBH.

public Nullable<double> Top { get; set; }

Property Value

Nullable<Double>

Gets or sets the right position of the page positioned at the right side of the window. Applies only if PageDestinationType is FitR.

public double Right { get; set; }

Property Value

Double

Bottom

Gets or sets the bottom position of the page positioned at the bottom side of the window. Applies only if PageDestinationType is FitR.

public double Bottom { get; set; }

Property Value

Double

Zoom

Gets or sets the zoom faction of the page. Applies only if PageDestinationType is Xyz.

public Nullable<double> Zoom { get; set; }

Property Value

Nullable<Double>

Opened

Gets or sets whether the outline item is opened (or expanded).

public bool Opened { get; set; }

Property Value

Boolean

Style

Gets or sets the style of the outline text.

public PdfOutlineStyle Style { get; set; }

Property Value

PdfOutlineStyle

PageDestinationType

Gets or sets the type of the page destination.

public PdfPageDestinationType PageDestinationType { get; set; }

Property Value

PdfPageDestinationType

TextColor

Gets or sets the color of the text.

public XColor TextColor { get; set; }

Property Value

XColor
The color of the text.

HasChildren

Gets a value indicating whether this outline object has child items.

public bool HasChildren { get; }

Property Value

Boolean

Outlines

Gets the outline collection of this node.

public PdfOutlineCollection Outlines { get; }

Property Value

PdfOutlineCollection

Elements

Gets the dictionary containing the elements of this dictionary.

public DictionaryElements Elements { get; }

Property Value

DictionaryElements

Stream

Gets or sets the PDF stream belonging to this dictionary. Returns null if the dictionary has no stream. To create the stream, call the CreateStream function.

public PdfStream Stream { get; set; }

Property Value

PdfStream

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.

Constructors

PdfOutline()

Initializes a new instance of the PdfOutline class.

public PdfOutline()

PdfOutline(PdfDictionary)

Initializes a new instance from an existing dictionary. Used for object type transformation.

public PdfOutline(PdfDictionary dict)

Parameters

dict PdfDictionary

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

Initializes a new instance of the PdfOutline class.

public PdfOutline(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.

PdfOutline(String, PdfPage, Boolean, PdfOutlineStyle)

Initializes a new instance of the PdfOutline class.

public PdfOutline(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.

PdfOutline(String, PdfPage, Boolean)

Initializes a new instance of the PdfOutline class.

public PdfOutline(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.

PdfOutline(String, PdfPage)

Initializes a new instance of the PdfOutline class.

public PdfOutline(string title, PdfPage destinationPage)

Parameters

title String
The outline text.

destinationPage PdfPage
The destination page.

Methods

CountOpen()

Counts the open outline items. Not yet used.

internal int CountOpen()

Returns

Int32

PrepareForSave()

Creates key/values pairs according to the object structure.

internal void PrepareForSave()

WriteObject(PdfWriter)

internal void WriteObject(PdfWriter writer)

Parameters

writer PdfWriter