Class PdfActionAnnotation
Represents the annotation with associated action.
Inheritance
System.Object
PdfActionAnnotation
Implements
System.ComponentModel.INotifyPropertyChanged
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Syncfusion.Pdf.Interactive
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class PdfActionAnnotation : PdfActionLinkAnnotation, IPdfWrapper, INotifyPropertyChanged
Constructors
PdfActionAnnotation(RectangleF, PdfAction)
Initializes a new instance of the PdfActionAnnotation class with specified bounds and action.
Declaration
public PdfActionAnnotation(RectangleF rectangle, PdfAction action)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.RectangleF | rectangle | The bounds of the annotation. |
PdfAction | action | The PDF action that can be triggered with different actions. |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new rectangle.
RectangleF actionAnnotationBounds = new RectangleF(10, 40, 100, 30);
//Set the go to action
PdfGoToAction gotoAction = new PdfGoToAction(page);
//Set destination location.
gotoAction.Destination = new PdfDestination(page, new PointF(0, 100));
//Create Action annotation.
PdfActionAnnotation actionAnnotation = new PdfActionAnnotation(actionAnnotationBounds, gotoAction);
//Set the text and font.
actionAnnotation.Color = new PdfColor(Color.Red);
//Add this annotation to a new page.
page.Annotations.Add(actionAnnotation);
//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 actionAnnotationBounds As New RectangleF(10, 40, 100, 30)
'Set the go to action.
Dim gotoAction As New PdfGoToAction(page)
'Set destination location
gotoAction.Destination = New PdfDestination(page, New PointF(0, 100))
'Create Action annotation.
Dim actionAnnotation As New PdfActionAnnotation(actionAnnotationBounds, gotoAction)
'Set the text and font.
actionAnnotation.Color = New PdfColor(Color.Red)
'Add this annotation to a new page.
page.Annotations.Add(actionAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document.
document.Close(True)
See Also
Methods
Save()
Saves annotation object.
Declaration
protected override void Save()
Overrides
Implements
System.ComponentModel.INotifyPropertyChanged