cete.dynamicpdf.gotoaction
GoToAction
- Namespace: ceTe.DynamicPDF
- Assemblies: DynamicPDF.CoreSuite.dll
Represents a goto action.
public class GoToAction : OutlineAnnotationAction
Public Class GoToAction
Inherits OutlineAnnotationAction
Inheritance: Object → Action → OutlineAnnotationAction → GoToAction
Examples
The following example shows how to use go to action.
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements.Forms
Imports ceTe.DynamicPDF.PageElements
Module MyModule
Sub Main()
' Create a PDF Document
Dim MyDocument As Document = New Document()
' Create a pages and add it to the document
Dim MyPage As Page = New Page()
Dim MyPage1 As Page = New Page()
MyDocument.Pages.Add(MyPage)
MyDocument.Pages.Add(MyPage1)
Dim MyButton As Button = New Button("btn", 50, 150, 100, 30)
MyButton.Label = "Click Here"
' Create labels
Dim MyLabel1 As Label = New Label("Click the button to go to the second page :", 50, 100, 300, 30)
Dim MyLabel2 AS Label = New Label("This is the second page :", 50, 100, 200, 30)
' Add the labels and button to the page
MyPage.Elements.Add(MyButton)
MyPage.Elements.Add(MyLabel1)
MyPage1.Elements.Add(MyLabel2)
' Create a goto action and assign to the button events.
Dim MyAction As GoToAction = New GoToAction(2, PageZoom.FitWidth)
MyButton.ReaderEvents.MouseUp = MyAction
' Save the PDF
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements.Forms;
using ceTe.DynamicPDF.PageElements;
public class Example
{
public static void CreatePDF(string outputPath)
{
// Create a PDF Document
Document document = new Document();
// Create pages and add it to the document
Page page = new Page();
Page page1 = new Page();
document.Pages.Add(page);
document.Pages.Add(page1);
Button button = new Button("btn", 50, 150, 100, 30);
button.Label = "Click Here";
// Create labels
Label label1 = new Label("Click the button to go to the second page :", 50, 100, 300, 30);
Label label2 = new Label("This is the second page :", 50, 100, 200, 30);
// Add the labels and button to the page
page.Elements.Add(button);
page.Elements.Add(label1);
page1.Elements.Add(label2);
// Create a goto action and assign to the button events.
GoToAction action = new GoToAction(2, PageZoom.FitWidth);
button.ReaderEvents.MouseUp = action;
// Save the PDF
document.Draw(outputPath);
}
}
Constructors
GoToAction(Int32, PageZoom)
Initializes a new instance of the goto action class.
public GoToAction(int pageNumber, PageZoom zoom)
Public Sub New (pageNumber As Integer, zoom As PageZoom)
Parameters
- pageNumber: Int32
Page number targeted by the destination.
- zoom: PageZoom
Zoom used to display the destination.
Properties
NextAction
Gets or sets next action for the current action. (Inherited from OutlineAnnotationAction)
public OutlineAnnotationAction NextAction { get; set; }
Public Property NextAction As OutlineAnnotationAction
Property Value
Methods
Draw(DocumentWriter)
Draws the action to the specified DocumentWriter object.
public void Draw(DocumentWriter writer)
Sub Draw(writer As DocumentWriter)
Parameters
- writer: DocumentWriter
The DocumentWriter object to receive the actions output.
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.
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 .
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.
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 .