PdfDestination Class

A destination: a page and how it is shown (ISO 32000-2, 12.3.2), the target of an outline item or a link. A destination can also target a structure element (PdfDestination.WithStructureElement), as PDF/UA-2 requires.

public sealed class PdfDestination

Properties

NameDescription
BottomGets the bottom coordinate of a PdfDestinationKind.FitRectangle destination.
KindGets how the page is shown.
LeftGets the left coordinate, or null to keep the current one.
PageGets the page.
RightGets the right coordinate of a PdfDestinationKind.FitRectangle destination.
StructureElementGets the structure element the destination targets (a structure destination, 12.3.2.3), or null. A destination with a structure element is written as a GoTo action whose /D is the page and whose /SD is the element (12.6.4.2).
TopGets the top coordinate, or null to keep the current one.
ZoomGets the zoom factor of a PdfDestinationKind.Xyz destination (1 is 100%), or null to keep the current one.

Gets the bottom coordinate of a PdfDestinationKind.FitRectangle destination.

public double? Bottom { get; }

Property value

double?

Gets how the page is shown.

public PdfDestinationKind Kind { get; }

Property value

PdfDestinationKind

Gets the left coordinate, or null to keep the current one.

public double? Left { get; }

Property value

double?

Gets the page.

public PdfPage Page { get; }

Property value

PdfPage

StructureElement

PdfDestination.cs

Gets the structure element the destination targets (a structure destination, 12.3.2.3), or null. A destination with a structure element is written as a GoTo action whose /D is the page and whose /SD is the element (12.6.4.2).

public PdfStructureElement? StructureElement { get; }

Property value

PdfStructureElement?

Gets the top coordinate, or null to keep the current one.

public double? Top { get; }

Property value

double?

Gets the zoom factor of a PdfDestinationKind.Xyz destination (1 is 100%), or null to keep the current one.

public double? Zoom { get; }

Property value

double?

Methods

NameDescription
Fit(PdfPage)Creates a destination that shows the whole page.
FitBoundingBox(PdfPage, PdfDestinationKind, double?)Creates a destination of another kind.
FitHorizontally(PdfPage, double?)Creates a destination that fits the width of the page in the window.
FitRectangle(PdfPage, PdfRectangle)Creates a destination that fits a rectangle of the page in the window.
FitVertically(PdfPage, double?)Creates a destination that fits the height of the page in the window.
WithStructureElement(PdfStructureElement)Creates a destination that also targets a structure element: the element that holds the content shown at the destination, such as a heading.
Xyz(PdfPage, double?, double?, double?)Creates a destination that shows a point of a page at the upper-left corner of the window.

Fit(PdfPage)

PdfDestination.cs

Creates a destination that shows the whole page.

public static PdfDestination Fit(PdfPage page)

Parameters

page PdfPage
The page.

Returns

PdfDestination The destination.

FitBoundingBox(PdfPage, PdfDestinationKind, double?)

PdfDestination.cs

Creates a destination of another kind.

public static PdfDestination FitBoundingBox(PdfPage page, PdfDestinationKind kind = PdfDestinationKind.FitBoundingBox, double? coordinate = null)

Parameters

page PdfPage
The page.
kind PdfDestinationKind
The kind: PdfDestinationKind.FitBoundingBox, PdfDestinationKind.FitBoundingBoxHorizontally (with coordinate as the top) or PdfDestinationKind.FitBoundingBoxVertically (with coordinate as the left).
coordinate double?
The coordinate of the kind.

Returns

PdfDestination The destination.

FitHorizontally(PdfPage, double?)

PdfDestination.cs

Creates a destination that fits the width of the page in the window.

public static PdfDestination FitHorizontally(PdfPage page, double? top)

Parameters

page PdfPage
The page.
top double?
The coordinate at the top of the window, or null to keep the current one.

Returns

PdfDestination The destination.

FitRectangle(PdfPage, PdfRectangle)

PdfDestination.cs

Creates a destination that fits a rectangle of the page in the window.

public static PdfDestination FitRectangle(PdfPage page, PdfRectangle rectangle)

Parameters

page PdfPage
The page.
rectangle PdfRectangle
The rectangle.

Returns

PdfDestination The destination.

FitVertically(PdfPage, double?)

PdfDestination.cs

Creates a destination that fits the height of the page in the window.

public static PdfDestination FitVertically(PdfPage page, double? left)

Parameters

page PdfPage
The page.
left double?
The coordinate at the left of the window, or null to keep the current one.

Returns

PdfDestination The destination.

WithStructureElement(PdfStructureElement)

PdfDestination.cs

Creates a destination that also targets a structure element: the element that holds the content shown at the destination, such as a heading.

public PdfDestination WithStructureElement(PdfStructureElement element)

Parameters

element PdfStructureElement
The structure element, of the document of the page.

Returns

PdfDestination A destination with the same page and view, and the structure element.

Exceptions

ArgumentException
The element is not an element of the document of the page.

Xyz(PdfPage, double?, double?, double?)

PdfDestination.cs

Creates a destination that shows a point of a page at the upper-left corner of the window.

public static PdfDestination Xyz(PdfPage page, double? left, double? top, double? zoom = null)

Parameters

page PdfPage
The page.
left double?
The left coordinate, or null to keep the current one.
top double?
The top coordinate, or null to keep the current one.
zoom double?
The zoom factor (1 is 100%), or null to keep the current one.

Returns

PdfDestination The destination.