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 PdfDestinationProperties
| Name | Description |
|---|---|
| Bottom | Gets the bottom coordinate of a PdfDestinationKind.FitRectangle destination. |
| Kind | Gets how the page is shown. |
| Left | Gets the left coordinate, or null to keep the current one. |
| Page | Gets the page. |
| Right | Gets the right coordinate of a PdfDestinationKind.FitRectangle destination. |
| StructureElement | 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). |
| Top | Gets the top coordinate, or null to keep the current one. |
| Zoom | Gets the zoom factor of a PdfDestinationKind.Xyz destination (1 is 100%), or null to keep the current one. |
Bottom
PdfDestination.csGets the bottom coordinate of a PdfDestinationKind.FitRectangle destination.
public double? Bottom { get; }Property value
Right
PdfDestination.csGets the right coordinate of a PdfDestinationKind.FitRectangle destination.
public double? Right { get; }Property value
StructureElement
PdfDestination.csGets 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
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
Methods
| Name | Description |
|---|---|
| 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.csCreates a destination that shows the whole page.
public static PdfDestination Fit(PdfPage page)FitBoundingBox(PdfPage, PdfDestinationKind, double?)
PdfDestination.csCreates a destination of another kind.
public static PdfDestination FitBoundingBox(PdfPage page, PdfDestinationKind kind = PdfDestinationKind.FitBoundingBox, double? coordinate = null)Parameters
pagePdfPage- The page.
kindPdfDestinationKind- The kind:
PdfDestinationKind.FitBoundingBox,PdfDestinationKind.FitBoundingBoxHorizontally(withcoordinateas the top) orPdfDestinationKind.FitBoundingBoxVertically(withcoordinateas the left). coordinatedouble?- The coordinate of the kind.
Returns
PdfDestination The destination.
FitHorizontally(PdfPage, double?)
PdfDestination.csCreates a destination that fits the width of the page in the window.
public static PdfDestination FitHorizontally(PdfPage page, double? top)Parameters
pagePdfPage- The page.
topdouble?- The coordinate at the top of the window, or
nullto keep the current one.
Returns
PdfDestination The destination.
FitRectangle(PdfPage, PdfRectangle)
PdfDestination.csCreates a destination that fits a rectangle of the page in the window.
public static PdfDestination FitRectangle(PdfPage page, PdfRectangle rectangle)Parameters
pagePdfPage- The page.
rectanglePdfRectangle- The rectangle.
Returns
PdfDestination The destination.
FitVertically(PdfPage, double?)
PdfDestination.csCreates a destination that fits the height of the page in the window.
public static PdfDestination FitVertically(PdfPage page, double? left)Parameters
pagePdfPage- The page.
leftdouble?- The coordinate at the left of the window, or
nullto keep the current one.
Returns
PdfDestination The destination.
WithStructureElement(PdfStructureElement)
PdfDestination.csCreates 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
elementPdfStructureElement- 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.csCreates 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
pagePdfPage- The page.
leftdouble?- The left coordinate, or
nullto keep the current one. topdouble?- The top coordinate, or
nullto keep the current one. zoomdouble?- The zoom factor (1 is 100%), or
nullto keep the current one.
Returns
PdfDestination The destination.