cete.dynamicpdf.javascriptaction
JavaScriptAction
- Namespace: ceTe.DynamicPDF
- Assemblies: DynamicPDF.CoreSuite.dll
Represents a JavaScript action.
public class JavaScriptAction : OutlineAnnotationAction
Public Class JavaScriptAction
Inherits OutlineAnnotationAction
Inheritance: Object → Action → OutlineAnnotationAction → JavaScriptAction
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 use the JavaScriptAction on a button.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements.Forms
Module MyModule
Sub Main()
' Create a PDF Document
Dim MyDocument As Document = New Document
' Create a PDF Page
Dim MyPage As Page = New Page(PageSize.Letter)
' Create an Button
Dim MyButton As Button = New Button("btn", 50, 50, 100, 50)
MyButton.Action = New JavaScriptAction("app.alert('Hello');")
MyButton.Behavior = Behavior.CreatePush("downLabel", "rolloverLabel")
MyButton.Label = "Push"
' Add the Button to the page
MyPage.Elements.Add(MyButton)
' Add pages to the document
MyDocument.Pages.Add(MyPage)
' Save the PDF document
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements.Forms;
public class Example
{
public static void CreatePDF(string outputPath)
{
// Create a PDF Document
Document document = new Document();
// Create a PDF Page
Page page = new Page( PageSize.Letter );
// Create an Button
Button button = new Button( "btn", 50, 50, 100, 50 );
button.Action = new JavaScriptAction( "app.alert('Hello');" );
button.Behavior = Behavior.CreatePush( "downLabel", "rolloverLabel" );
button.Label = "Push";
// Add the Button to the page
page.Elements.Add( button );
// Add pages to the document
document.Pages.Add( page );
// Save the PDF document
document.Draw( outputPath );
}
}
Remarks
For more details on using the JavaScript action take a look at the JavaScript topic.
Constructors
JavaScriptAction(String)
Initializes a new instance of the JavaScriptAction class.
public JavaScriptAction(string javaScript)
Public Sub New (javaScript As String)
Parameters
- javaScript: String
The JavaScript code.
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
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
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 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.
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.