Class PdfActionLinkAnnotation
Represents base class for link annotations with associated action.
Inheritance
System.Object
PdfActionLinkAnnotation
Implements
System.ComponentModel.INotifyPropertyChanged
Inherited Members
Namespace: Syncfusion.Pdf.Interactive
Assembly: Syncfusion.Pdf.Portable.dll
Syntax
public abstract class PdfActionLinkAnnotation : PdfLinkAnnotation, IPdfWrapper, INotifyPropertyChanged
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page
PdfPage page = document.Pages.Add();
//Create a new rectangle
RectangleF rectangle = new RectangleF(10, 40, 30, 30);
//Create a new file link annotation.
PdfFileLinkAnnotation fileLinkAnnotation = new PdfFileLinkAnnotation(rectangle, @"Input.png");
//Set a action to file link annotation.
PdfJavaScriptAction javaAction = new PdfJavaScriptAction("app.alert(\"You are looking at Java script action of PDF \")");
fileLinkAnnotation.Action = javaAction;
//Add this annotation to a new page.
page.Annotations.Add(fileLinkAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page
Dim page As PdfPage = document.Pages.Add()
'Create a new rectangle
Dim rectangle As New RectangleF(10, 40, 30, 30)
'Create a new file link annotation.
Dim fileLinkAnnotation As New PdfFileLinkAnnotation(rectangle, "Input.png")
'Set a action to file link annotation.
Dim javaAction As New PdfJavaScriptAction("app.alert(""You are looking at Java script action of PDF "")")
fileLinkAnnotation.Action = javaAction
'Add this annotation to a new page.
page.Annotations.Add(fileLinkAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
Constructors
PdfActionLinkAnnotation(RectangleF)
Initializes a new instance of the PdfActionLinkAnnotation class with specified bounds.
Declaration
public PdfActionLinkAnnotation(RectangleF rectangle)
Parameters
Type | Name | Description |
---|---|---|
RectangleF | rectangle | The bounds of the annotation. |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page
PdfPage page = document.Pages.Add();
//Create a new rectangle
RectangleF rectangle = new RectangleF(10, 40, 30, 30);
//Create a new file link annotation.
PdfFileLinkAnnotation fileLinkAnnotation = new PdfFileLinkAnnotation(rectangle, "input.png");
//Set a action to file link annotation.
PdfJavaScriptAction javaAction = new PdfJavaScriptAction("app.alert(\"You are looking at Java script action of PDF \")");
fileLinkAnnotation.Action = javaAction;
//Add this annotation to a new page.
page.Annotations.Add(fileLinkAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page
Dim page As PdfPage = document.Pages.Add()
'Create a new rectangle
Dim rectangle As New RectangleF(10, 40, 30, 30)
'Create a new file link annotation.
Dim fileLinkAnnotation As New PdfFileLinkAnnotation(rectangle, "input.png")
'Set a action to file link annotation.
Dim javaAction As New PdfJavaScriptAction("app.alert(""You are looking at Java script action of PDF "")")
fileLinkAnnotation.Action = javaAction
'Add this annotation to a new page.
page.Annotations.Add(fileLinkAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also
PdfActionLinkAnnotation(RectangleF, PdfAction)
Initializes a new instance of the PdfActionLinkAnnotation class with specified bounds and action to be performed.
Declaration
public PdfActionLinkAnnotation(RectangleF rectangle, PdfAction action)
Parameters
Type | Name | Description |
---|---|---|
RectangleF | rectangle | The bounds specifies the location of the drawn text. |
PdfAction | action | The PdfAction specifies an action to be executed when the link is activated. |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page
PdfPage page = document.Pages.Add();
//Create a new rectangle
RectangleF bounds = new RectangleF(10, 40, 30, 30);
//Create a new file link annotation.
PdfFileLinkAnnotation fileLinkAnnotation = new PdfFileLinkAnnotation(bounds, "Input.png");
//Set a action to file link annotation.
PdfJavaScriptAction javaAction = new PdfJavaScriptAction("app.alert(\"You are looking at Java script action of PDF \")");
fileLinkAnnotation.Action = javaAction;
//Add this annotation to a new page.
page.Annotations.Add(fileLinkAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page
Dim page As PdfPage = document.Pages.Add()
'Create a new rectangle
Dim rectangle As New RectangleF(10, 40, 30, 30)
'Create a new file link annotation.
Dim fileLinkAnnotation As New PdfFileLinkAnnotation(rectangle, "Input.png")
'Set a action to file link annotation.
Dim javaAction As New PdfJavaScriptAction("app.alert(""You are looking at Java script action of PDF "")")
fileLinkAnnotation.Action = javaAction
'Add this annotation to a new page.
page.Annotations.Add(fileLinkAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also
Properties
Action
Gets or sets the action for the link annotation.
Declaration
public virtual PdfAction Action { get; set; }
Property Value
Type | Description |
---|---|
PdfAction | The action to be executed when the link is activated. |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page
PdfPage page = document.Pages.Add();
//Create a new rectangle
RectangleF rectangle = new RectangleF(10, 40, 30, 30);
//Create a new file link annotation.
PdfFileLinkAnnotation fileLinkAnnotation = new PdfFileLinkAnnotation(rectangle, @"Input.png");
//Set a action to file link annotation.
PdfJavaScriptAction javaAction = new PdfJavaScriptAction("app.alert(\"You are looking at Java script action of PDF \")");
fileLinkAnnotation.Action = javaAction;
//Add this annotation to a new page.
page.Annotations.Add(fileLinkAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page
Dim page As PdfPage = document.Pages.Add()
'Create a new rectangle
Dim rectangle As New RectangleF(10, 40, 30, 30)
'Create a new file link annotation.
Dim fileLinkAnnotation As New PdfFileLinkAnnotation(rectangle, "Input.png")
'Set a action to file link annotation.
Dim javaAction As New PdfJavaScriptAction("app.alert(""You are looking at Java script action of PDF "")")
fileLinkAnnotation.Action = javaAction
'Add this annotation to a new page.
page.Annotations.Add(fileLinkAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also
Implements
System.ComponentModel.INotifyPropertyChanged