Class PdfAnnotationActions
Represents additional actions of the annotations.
Inheritance
Namespace: Syncfusion.Pdf.Interactive
Assembly: Syncfusion.Pdf.Portable.dll
Syntax
public class PdfAnnotationActions : Object, IPdfWrapper
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Create a new PdfButtonField
PdfButtonField submitButton = new PdfButtonField(page, "submitButton");
submitButton.Bounds = new RectangleF(25, 160, 100, 20);
submitButton.Text = "Launch";
//Create a new PdfLaunchAction
PdfLaunchAction launchAction = new PdfLaunchAction(@"Input.txt");
//Set the launch action to submit button
submitButton.Actions.MouseLeave = launchAction;
//Add the submit button to a new document.
document.Form.Fields.Add(submitButton);
//Save document to disk.
document.Save("Output.pdf");
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Creates a new page and adds it as the last page of the document
Dim page As PdfPage = document.Pages.Add()
'Create a new PdfButtonField
Dim submitButton As New PdfButtonField(page, "submitButton")
submitButton.Bounds = New RectangleF(25, 160, 100, 20)
submitButton.Text = "Launch"
'Create a new PdfLaunchAction
Dim launchAction As New PdfLaunchAction("Input.txt")
'Set the launch action to submit button
submitButton.Actions.MouseLeave = launchAction
'Add the submit button to a new document.
document.Form.Fields.Add(submitButton)
'Save document to disk.
document.Save("Output.pdf")
document.Close(True)
Constructors
PdfAnnotationActions()
Initializes a new instance of the PdfAnnotationActions class.
Declaration
public PdfAnnotationActions()
Examples
PdfAnnotationActions annotationActions = new PdfAnnotationActions();
//Create a new PdfJavaScriptAction
PdfJavaScriptAction javaAction = new PdfJavaScriptAction("app.alert(\"You are looking at Java script action of PDF \")");
annotationActions.MouseEnter = javaAction;
Dim annotationActions As PdfAnnotationActions = New PdfAnnotationActions()
'Create a new PdfJavaScriptAction.
Dim javaAction As PdfJavaScriptAction = New PdfJavaScriptAction("app.alert(\"You are looking at Java script action of PDF \")")
annotationActions.MouseEnter = javaAction
See Also
Properties
GotFocus
Gets or sets the action to be performed when the annotation receives the input focus.
Declaration
public PdfAction GotFocus { get; set; }
Property Value
Type | Description |
---|---|
PdfAction | The got focus action. |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Create a new PdfButtonField
PdfButtonField submitButton = new PdfButtonField(page, "submitButton");
submitButton.Bounds = new RectangleF(25, 160, 100, 20);
submitButton.Text = "Launch";
//Create a new PdfLaunchAction
PdfLaunchAction launchAction = new PdfLaunchAction(@"..\..\Data\Sample.txt");
//Set the launch action to submit button
submitButton.Actions.GotFocus = launchAction;
//Add the submit button to a new document.
document.Form.Fields.Add(submitButton);
//Save document to disk.
document.Save("LaunchAction.pdf");
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Creates a new page and adds it as the last page of the document
Dim page As PdfPage = document.Pages.Add()
'Create a new PdfButtonField
Dim submitButton As New PdfButtonField(page, "submitButton")
submitButton.Bounds = New RectangleF(25, 160, 100, 20)
submitButton.Text = "Launch"
'Create a new PdfLaunchAction
Dim launchAction As New PdfLaunchAction("..\..\Data\Sample.txt")
'Set the launch action to submit button
submitButton.Actions.GotFocus = launchAction
'Add the submit button to a new document.
document.Form.Fields.Add(submitButton)
'Save document to disk.
document.Save("LaunchAction.pdf")
document.Close(True)
See Also
LostFocus
Gets or sets the action to be performed when the annotation loses the input focus.
Declaration
public PdfAction LostFocus { get; set; }
Property Value
Type | Description |
---|---|
PdfAction | The lost focus action. |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Create a new PdfButtonField
PdfButtonField submitButton = new PdfButtonField(page, "submitButton");
submitButton.Bounds = new RectangleF(25, 160, 100, 20);
submitButton.Text = "Launch";
//Create a new PdfLaunchAction
PdfLaunchAction launchAction = new PdfLaunchAction(@"..\..\Data\Sample.txt");
//Set the launch action to submit button
submitButton.Actions.LostFocus = launchAction;
//Add the submit button to a new document.
document.Form.Fields.Add(submitButton);
//Save document to disk.
document.Save("LaunchAction.pdf");
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Creates a new page and adds it as the last page of the document
Dim page As PdfPage = document.Pages.Add()
'Creata a new PdfButtonField
Dim submitButton As New PdfButtonField(page, "submitButton")
submitButton.Bounds = New RectangleF(25, 160, 100, 20)
submitButton.Text = "Launch"
'Create a new PdfLaunchAction
Dim launchAction As New PdfLaunchAction("..\..\Data\Sample.txt")
'Set the launch action to submit button
submitButton.Actions.LostFocus = launchAction
'Add the submit button to a new document.
document.Form.Fields.Add(submitButton)
'Save document to disk.
document.Save("LaunchAction.pdf")
document.Close(True)
See Also
MouseDown
Gets or sets the action to be performed when the mouse button is pressed inside the annotation�s active area.
Declaration
public PdfAction MouseDown { get; set; }
Property Value
Type | Description |
---|---|
PdfAction | The mouse down action. |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Create a new PdfButtonField
PdfButtonField submitButton = new PdfButtonField(page, "submitButton");
submitButton.Bounds = new RectangleF(25, 160, 100, 20);
submitButton.Text = "Launch";
//Create a new PdfLaunchAction
PdfLaunchAction launchAction = new PdfLaunchAction(@"..\..\Data\Sample.txt");
//Set the launch action to submit button
submitButton.Actions.MouseDown = launchAction;
//Add the submit button to a new document.
document.Form.Fields.Add(submitButton);
//Save document to disk.
document.Save("LaunchAction.pdf");
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Creates a new page and adds it as the last page of the document
Dim page As PdfPage = document.Pages.Add()
'Create a new PdfButtonField
Dim submitButton As New PdfButtonField(page, "submitButton")
submitButton.Bounds = New RectangleF(25, 160, 100, 20)
submitButton.Text = "Launch"
'Create a new PdfLaunchAction
Dim launchAction As New PdfLaunchAction("..\..\Data\Sample.txt")
'Set the launch action to submit button
submitButton.Actions.MouseDown = launchAction
'Add the submit button to a new document.
document.Form.Fields.Add(submitButton)
'Save document to disk.
document.Save("LaunchAction.pdf")
document.Close(True)
See Also
MouseEnter
Gets or sets the action to be performed when the cursor enters the annotation�s active area.
Declaration
public PdfAction MouseEnter { get; set; }
Property Value
Type | Description |
---|---|
PdfAction | The mouse enter action. |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Create a new PdfButtonField
PdfButtonField submitButton = new PdfButtonField(page, "submitButton");
submitButton.Bounds = new RectangleF(25, 160, 100, 20);
submitButton.Text = "Launch";
//Create a new PdfLaunchAction
PdfLaunchAction launchAction = new PdfLaunchAction(@"..\..\Data\Sample.txt");
//Set the launch action to submit button
submitButton.Actions.MouseEnter = launchAction;
//Add the submit button to a new document.
document.Form.Fields.Add(submitButton);
//Save document to disk.
document.Save("LaunchAction.pdf");
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Creates a new page and adds it as the last page of the document
Dim page As PdfPage = document.Pages.Add()
'Create a new PdfButtonField
Dim submitButton As New PdfButtonField(page, "submitButton")
submitButton.Bounds = New RectangleF(25, 160, 100, 20)
submitButton.Text = "Launch"
'Create a new PdfLaunchAction
Dim launchAction As New PdfLaunchAction("..\..\Data\Sample.txt")
'Set the launch action to submit button
submitButton.Actions.MouseEnter = launchAction
'Add the submit button to a new document.
document.Form.Fields.Add(submitButton)
'Save document to disk.
document.Save("LaunchAction.pdf")
document.Close(True)
See Also
MouseLeave
Gets or sets the action to be performed when the cursor exits the annotation�s active area.
Declaration
public PdfAction MouseLeave { get; set; }
Property Value
Type | Description |
---|---|
PdfAction | The mouse leave action. |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Create a new PdfButtonField
PdfButtonField submitButton = new PdfButtonField(page, "submitButton");
submitButton.Bounds = new RectangleF(25, 160, 100, 20);
submitButton.Text = "Launch";
//Create a new PdfLaunchAction
PdfLaunchAction launchAction = new PdfLaunchAction(@"..\..\Data\Sample.txt");
//Set the launch action to submit button
submitButton.Actions.MouseLeave = launchAction;
//Add the submit button to a new document.
document.Form.Fields.Add(submitButton);
//Save document to disk.
document.Save("LaunchAction.pdf");
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Creates a new page and adds it as the last page of the document
Dim page As PdfPage = document.Pages.Add()
'Create a new PdfButtonField
Dim submitButton As New PdfButtonField(page, "submitButton")
submitButton.Bounds = New RectangleF(25, 160, 100, 20)
submitButton.Text = "Launch"
'Create a new PdfLaunchAction
Dim launchAction As New PdfLaunchAction("..\..\Data\Sample.txt")
'Set the launch action to submit button
submitButton.Actions.MouseLeave = launchAction
'Add the submit button to a new document.
document.Form.Fields.Add(submitButton)
'Save document to disk.
document.Save("LaunchAction.pdf")
document.Close(True)
See Also
MouseUp
Gets or sets the action to be performed when the mouse button is released inside the annotation�s active area..
Declaration
public PdfAction MouseUp { get; set; }
Property Value
Type | Description |
---|---|
PdfAction | The mouse up action. |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
//Create a new PdfButtonField
PdfButtonField submitButton = new PdfButtonField(page, "submitButton");
submitButton.Bounds = new RectangleF(25, 160, 100, 20);
submitButton.Text = "Launch";
//Create a new PdfLaunchAction
PdfLaunchAction launchAction = new PdfLaunchAction(@"..\..\Data\Sample.txt");
//Set the launch action to submit button
submitButton.Actions.MouseUp = launchAction;
//Add the submit button to a new document.
document.Form.Fields.Add(submitButton);
//Save document to disk.
document.Save("LaunchAction.pdf");
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Creates a new page and adds it as the last page of the document
Dim page As PdfPage = document.Pages.Add()
'Create a new PdfButtonField
Dim submitButton As New PdfButtonField(page, "submitButton")
submitButton.Bounds = New RectangleF(25, 160, 100, 20)
submitButton.Text = "Launch"
'Create a new PdfLaunchAction
Dim launchAction As New PdfLaunchAction("..\..\Data\Sample.txt")
'Set the launch action to submit button
submitButton.Actions.MouseUp = launchAction
'Add the submit button to a new document.
document.Form.Fields.Add(submitButton)
'Save document to disk.
document.Save("LaunchAction.pdf")
document.Close(True)