PdfDestination Class
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.
public sealed class PdfDestination : PdfObject
Public NotInheritable Class PdfDestination
Inherits PdfObject
- Inheritance:
- System.ObjectPdfDestination
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.
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.
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.
Property Value
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).
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.
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.
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.
public PdfDestinationViewType ViewType { get; }
Public ReadOnly Property ViewType As PdfDestinationViewType
Property Value
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.
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:
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.
Returns
- System.String
A System.String that represents this PdfDestination instance.
Overrides
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) |