Class PdfActionLinkAnnotation
- Namespace
- Syncfusion.Pdf.Interactive
- Assembly
- Syncfusion.Pdf.Portable.dll
Represents base class for link annotations with associated action.
public abstract class PdfActionLinkAnnotation : PdfLinkAnnotation, INotifyPropertyChanged
- Inheritance
-
PdfActionLinkAnnotation
- Implements
- Derived
- Inherited Members
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.
public PdfActionLinkAnnotation(RectangleF rectangle)
Parameters
rectangle
RectangleFThe 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.
public PdfActionLinkAnnotation(RectangleF rectangle, PdfAction action)
Parameters
rectangle
RectangleFThe bounds specifies the location of the drawn text.
action
PdfActionThe 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.
public virtual PdfAction Action { get; set; }
Property Value
- 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