GemBox.Pdf
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    PdfDestination Class

    Namespace:
    GemBox.Pdf
    Assembly:
    GemBox.Pdf.dll

    A destination defines a particular view of a document, consisting of the following items:

    • The page of the document that shall be displayed.
    • The location of the document window on that page.
    • The magnification (zoom) factor.
    • C#
    • VB.NET
    public sealed class PdfDestination : PdfObject
    Public NotInheritable Class PdfDestination
        Inherits PdfObject
    Inheritance:
    System.Object
    PdfObject
    PdfDestination

    Properties

    Bottom

    Gets or sets the vertical coordinate of the bottom-right corner of the window expressed in the default user space coordinate system or null if the value is to be retained unchanged.

    • C#
    • VB.NET
    public double? Bottom { get; set; }
    Public Property Bottom As Double?
    Property Value
    System.Nullable<System.Double>

    The vertical coordinate of the bottom-right corner of the window expressed in the default user space coordinate system or null if the value is to be retained unchanged.

    Exceptions
    System.ArgumentNullException

    Value cannot be null.

    System.InvalidOperationException

    The Bottom can be set only for FitRectangle view type.

    Left

    Gets or sets the horizontal coordinate of the upper-left corner of the window expressed in the default user space coordinate system or null if the value is to be retained unchanged.

    • C#
    • VB.NET
    public double? Left { get; set; }
    Public Property Left As Double?
    Property Value
    System.Nullable<System.Double>

    The horizontal coordinate of the upper-left corner of the window expressed in the default user space coordinate system or null if the value is to be retained unchanged.

    Exceptions
    System.ArgumentNullException

    Value cannot be null for FitRectangle view type.

    System.InvalidOperationException

    The Left can be set only for LeftTopZoom, FitPageVertical, FitRectangle and FitContentVertical view types.

    Page

    Gets or sets the destination PdfPage object.

    Specifying a destination explicitly in a PDF file, page is an indirect reference to a page object.

    • C#
    • VB.NET
    public PdfPage Page { get; set; }
    Public Property Page As PdfPage
    Property Value
    PdfPage

    The destination PdfPage object.

    Exceptions
    System.ArgumentNullException

    Value is null.

    PageNumber

    Gets or sets the destination page number.

    Should be used only in a context of a remote go-to action (see 12.6.4.3 Remote Go-To Actions).

    • C#
    • VB.NET
    public int? PageNumber { get; set; }
    Public Property PageNumber As Integer?
    Property Value
    System.Nullable<System.Int32>

    The destination page number. The first page is numbered 0.

    Exceptions
    System.ArgumentNullException

    Value is null.

    System.ArgumentOutOfRangeException

    Value is less than zero.

    Right

    Gets or sets the horizontal coordinate of the bottom-right corner of the window expressed in the default user space coordinate system or null if the value is to be retained unchanged.

    • C#
    • VB.NET
    public double? Right { get; set; }
    Public Property Right As Double?
    Property Value
    System.Nullable<System.Double>

    The horizontal coordinate of the bottom-right corner of the window expressed in the default user space coordinate system or null if the value is to be retained unchanged.

    Exceptions
    System.ArgumentNullException

    Value cannot be null.

    System.InvalidOperationException

    The Right can be set only for FitRectangle view type.

    Top

    Gets or sets the vertical coordinate of the upper-left corner of the window expressed in the default user space coordinate system or null if the value is to be retained unchanged.

    • C#
    • VB.NET
    public double? Top { get; set; }
    Public Property Top As Double?
    Property Value
    System.Nullable<System.Double>

    The vertical coordinate of the upper-left corner of the window expressed in the default user space coordinate system or null if the value is to be retained unchanged.

    Exceptions
    System.ArgumentNullException

    Value cannot be null for FitRectangle view type.

    System.InvalidOperationException

    The Top can be set only for LeftTopZoom, FitPageHorizontal, FitRectangle and FitContentHorizontal view types.

    ViewType

    Gets the PdfDestinationViewType of this PdfDestination instance.

    • C#
    • VB.NET
    public PdfDestinationViewType ViewType { get; }
    Public ReadOnly Property ViewType As PdfDestinationViewType
    Property Value
    PdfDestinationViewType

    The PdfDestinationViewType of this PdfDestination instance.

    Zoom

    Gets or sets the zoom factor or null if the value is to be retained unchanged.

    Value 1 represents 100%, 0.5 represents 50%, 1.5 represents 150%, etc.

    • C#
    • VB.NET
    public double? Zoom { get; set; }
    Public Property Zoom As Double?
    Property Value
    System.Nullable<System.Double>

    The zoom factor or null if the value is to be retained unchanged.

    Exceptions
    System.InvalidOperationException

    The Zoom can be set only for LeftTopZoom view type.

    Methods

    SetView(PdfDestinationViewType, Nullable<Double>[])

    Sets the view and the view's parameters where parameters represent the following values depending on the viewType parameter:

    • FitRectangle

      Left, Bottom, Right and Top.

    • LeftTopZoom

      Left, Top and Zoom.

    • FitPageVertical and FitContentVertical Left.
    • FitPageHorizontal and FitContentHorizontal Top.
    • FitPage and FitContentNone.

    • C#
    • VB.NET
    public void SetView(PdfDestinationViewType viewType, params double? [] parameters)
    Public Sub SetView(viewType As PdfDestinationViewType, ParamArray parameters As Double?())
    Parameters
    viewType
    PdfDestinationViewType

    Type of the view.

    parameters
    System.Nullable<System.Double>[]

    The parameters of the view.

    Exceptions
    System.ArgumentNullException

    parameters is null when they are required.

    System.ArgumentException

    The number of passed parameters is not according to the documentation.

    ToString()

    Returns a System.String that represents this PdfDestination instance.

    • C#
    • VB.NET
    public override string ToString()
    Public Overrides Function ToString As String
    Returns
    System.String

    A System.String that represents this PdfDestination instance.

    Overrides
    System.Object.ToString()
    Remarks

    This method should be used primarily for debugging purposes and should be considered volatile (format of its return value might change in future versions).

    Inherited Properties

    Metadata

    (Optional; PDF 1.4) A metadata stream containing metadata for the component.

    (Inherited from PdfObject)

    Extension Methods

    PdfObjectExtensions.GetDictionary(PdfObject)
    PdfObjectExtensions.GetOrAddDictionary(PdfObject)
    PdfObjectExtensions.GetArray(PdfObject)

    See Also

    PDF Specification ISO 32000-1:2008, section '12.3.2 Destinations'
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.