Skip to main content

FileOpenAction

Version: 12.0

cete.dynamicpdf.fileopenaction

FileOpenAction​

Represents a file open action.

public class FileOpenAction : OutlineAnnotationAction
Public Class FileOpenAction
Inherits OutlineAnnotationAction

Inheritance: Object → Action → OutlineAnnotationAction → FileOpenAction

Licensing Info​

This class is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Examples​

The following example shows how to use file open 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 page and add it to the document
Dim MyPage As Page = New Page()
MyDocument.Pages.Add(MyPage)

Dim MyButton As Button = New Button("btn", 50, 150, 100, 30)
MyButton.Label = "Click Here"

' Create a label
Dim MyLabel1 As Label = New Label("Click the button to open the specified file :", 50, 100, 300, 30)

' Add the label and button to the page
MyPage.Elements.Add(MyButton)
MyPage.Elements.Add(MyLabel1)

' Create a file open action and assign to the button events.
Dim MyAction As FileOpenAction = New FileOpenAction("Path of the file to open",FileLaunchMode.NewWindow)
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 filePathToOpen, string outputPath)
{
// Create a PDF Document
Document document = new Document();

// Create page and add it to the document
Page page = new Page();
document.Pages.Add(page);

Button button = new Button("btn", 50, 150, 100, 30);
button.Label = "Click Here";

// Create a label
Label label1 = new Label("Click the button to open the specified file :", 50, 100, 300, 30);

// Add the label and button to the page
page.Elements.Add(button);
page.Elements.Add(label1);

// Create a file open action and assign to the button events.
FileOpenAction action = new FileOpenAction(filePathToOpen, FileLaunchMode.NewWindow);
button.ReaderEvents.MouseUp = action;

// Save the PDF
document.Draw(outputPath);
}
}

Constructors​

FileOpenAction(String)​

Initializes a new instance of the file open action class.

public FileOpenAction(string filePath)
Public Sub New (filePath As String)

Parameters​

The path of the open file.

Licensing Info​

This constructor is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

FileOpenAction(String, FileLaunchMode)​

Initializes a new instance of the file open action class.

public FileOpenAction(string filePath, FileLaunchMode mode)
Public Sub New (filePath As String, mode As FileLaunchMode)

Parameters​

The path of the open file.

The file open mode.

Licensing Info​

This constructor is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

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​

OutlineAnnotationAction

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Methods​

Draw(DocumentWriter)​

Draws the action to the specified DocumentWriter object.

public void Draw(DocumentWriter writer)
Sub Draw(writer As DocumentWriter)

Parameters​

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:

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​

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:

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:

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:

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:

See Also​

ceTe.DynamicPDF