cete.dynamicpdf.xydestination
XYDestination
- Namespace: ceTe.DynamicPDF
- Assemblies: DynamicPDF.CoreSuite.dll
Represents a destination to a coordinate on a page.
public class XYDestination : Destination
Public Class XYDestination
Inherits Destination
Inheritance: Object → Action → Destination → XYDestination
Licensing Info
This class is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Examples
This example shows how to create an outline for a PDF document using XYDestination.
Imports System
Imports ceTe.DynamicPDF
Module MyModule
Sub Main()
' Create a PDF Document
Dim MyDocument As Document = New Document
' Add three blank pages
MyDocument.Pages.Add(New Page(PageSize.Letter))
MyDocument.Pages.Add(New Page(PageSize.Letter))
MyDocument.Pages.Add(New Page(PageSize.Letter))
' Add a top level outline and set properties
Dim MyOutline1 As Outline = MyDocument.Outlines.Add("Outline1")
MyOutline1.Style = TextStyle.Bold
MyOutline1.Color = New RgbColor(1.0F, 0.0F, 0.0F)
' Add child outlines
Dim MyOutline1A As Outline = MyOutline1.ChildOutlines.Add("Outline1A", New UrlAction("http://www.mydomain.com"))
MyOutline1A.Expanded = False
Dim MyOutline1A1 As Outline = MyOutline1A.ChildOutlines.Add("Outline1A1", New XYDestination(2, 0, 0))
Dim MyOutline1A2 As Outline = MyOutline1A.ChildOutlines.Add("Outline1A2", New ZoomDestination(2, PageZoom.FitHeight))
Dim MyOutline1B As Outline = MyOutline1.ChildOutlines.Add("Outline1B", New ZoomDestination(2, PageZoom.FitWidth))
' Add a second top level outline
Dim MyOutline2 As Outline = MyDocument.Outlines.Add("Outline2", New XYDestination(3, 0, 300))
' Add a child outline
Dim MyOutline2A As Outline = MyOutline2.ChildOutlines.Add("Outline2A")
' Save the PDF document
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
public class Example
{
public static void CreatePDF(string outputPath)
{
// Create a PDF Document
Document document = new Document();
// Add three blank pages
document.Pages.Add(new Page(PageSize.Letter));
document.Pages.Add(new Page(PageSize.Letter));
document.Pages.Add(new Page(PageSize.Letter));
// Add a top level outline and set properties
Outline outline1 = document.Outlines.Add("Outline1");
outline1.Style = TextStyle.Bold;
outline1.Color = new RgbColor(1.0f, 0.0f, 0.0f);
// Add child outlines
Outline outline1A = outline1.ChildOutlines.Add("Outline1A", new UrlAction("http://www.mydomain.com"));
outline1A.Expanded = false;
Outline outline1A1 = outline1A.ChildOutlines.Add("Outline1A1", new XYDestination(2, 0, 0));
Outline outline1A2 = outline1A.ChildOutlines.Add("Outline1A2", new ZoomDestination(2, PageZoom.FitHeight));
Outline outline1B = outline1.ChildOutlines.Add("Outline1B", new ZoomDestination(2, PageZoom.FitWidth));
// Add a second top level outline
Outline outline2 = document.Outlines.Add("Outline2", new XYDestination(3, 0, 300));
// Add a child outline
Outline outline2A = outline2.ChildOutlines.Add("Outline2A");
// Save the PDF document
document.Draw(outputPath);
}
}
Remarks
This class can be used to specify a certain page and X Y location for defining a Link or a Bookmark .
Constructors
XYDestination(Int32, Single, Single)
Initializes a new instance of the XYDestination class.
public XYDestination(int pageNumber, float x, float y)
Public Sub New (pageNumber As Integer, x As Single, y As Single)
Parameters
- pageNumber: Int32
Page number targeted by the destination.
- x: Single
X coordinate targeted by the destination.
- y: Single
Y coordinate targeted by the destination.
Licensing Info
This constructor is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Properties
PageNumber
Gets or sets the page number targeted by the destination. (Inherited from Destination)
public int PageNumber { get; set; }
Public Property PageNumber As Int32
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
X
Gets or sets the X coordinate targeted by the destination.
public float X { get; set; }
Public Property X As Single
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Y
Gets or sets the Y coordinate targeted by the destination.
public float Y { get; set; }
Public Property Y As Single
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Methods
Draw(DocumentWriter)
Draws the destination to the specified DocumentWriter object.
public void Draw(DocumentWriter writer)
Sub Draw(writer As DocumentWriter)
Parameters
- writer: DocumentWriter
DocumentWriter object to receive the destinations output.
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Equals(Object)
Determines whether the specified Object is equal to the current Object . (Inherited from Object)
public bool Equals(Object obj)
Function Equals(obj As Object) As Boolean
Parameters
- obj: Object
The Object to compare with the current Object .
Returns
true if the specified Object is equal to the current Object ; otherwise, false.
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
GetHashCode()
Serves as a hash function for a particular type. (Inherited from Object)
public int GetHashCode()
Function GetHashCode() As Integer
Returns
A hash code for the current Object .
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
GetType()
Gets the Type of the current instance. (Inherited from Object)
public Type GetType()
Function GetType() As Type
Returns
The Type instance that represents the exact runtime type of the current instance.
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
ToString()
Returns a String that represents the current Object . (Inherited from Object)
public string ToString()
Function ToString() As String
Returns
A String that represents the current Object .
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.