FileOpenAction
Represents a file open action.
public class FileOpenAction : OutlineAnnotationAction
Inheritance: ObjectActionOutlineAnnotationActionFileOpenAction
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
The following example shows how to use file open action.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. |
FileOpenAction(String, FileLaunchMode) | Initializes a new instance of the file open action class. |
Properties
NextAction | Gets or sets next action for the current action. (Inherited from OutlineAnnotationAction) |
Methods
Draw(DocumentWriter) | Draws the action to the specified DocumentWriter object. |
Equals(Object) | Determines whether the specified Object is equal to the current Object . (Inherited from Object) |
GetHashCode() | Serves as a hash function for a particular type. (Inherited from Object) |
GetType() | Gets the Type of the current instance. (Inherited from Object) |
ToString() | Returns a String that represents the current Object . (Inherited from Object) |