Class PdfDocumentLinkAnnotation
Represents an annotation object with holds link on another location within a document.
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 PdfDocumentLinkAnnotation : PdfLinkAnnotation, IPdfWrapper, INotifyPropertyChanged
Remarks
This PdfDocumentLinkAnnotation class is used to navigate the specific destination within the document. Please refer the UG docuemntation link
Examples
//Create the PDF Document
PdfDocument document = new PdfDocument();
//Create a new page.
PdfPage page = document.Pages.Add();
//Create a new rectangle
RectangleF docLinkAnnotationRectangle = new RectangleF(10, 40, 30, 30);
//Create a new document link annotation.
PdfDocumentLinkAnnotation documentAnnotation = new PdfDocumentLinkAnnotation(docLinkAnnotationRectangle);
//Create a new page .
PdfPage page2 = document.Pages.Add();
//Set the pdf destination.
documentAnnotation.Destination = new PdfDestination(page2);
//Set the pdf destination location.
documentAnnotation.Destination.Location = new Point(10, 0);
//Add this annotation to a new page.
page.Annotations.Add(documentAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create the PDF Document
Dim document As New PdfDocument()
'Create a new page.
Dim page As PdfPage = document.Pages.Add()
'Create a new rectangle
Dim docLinkAnnotationRectangle As New RectangleF(10, 40, 30, 30)
'Create a new document link annotation.
Dim documentAnnotation As New PdfDocumentLinkAnnotation(docLinkAnnotationRectangle)
'Create a new page .
Dim page2 As PdfPage = document.Pages.Add()
'Set the pdf destination.
documentAnnotation.Destination = New PdfDestination(page2)
'Set the pdf destination location.
documentAnnotation.Destination.Location = New Point(10, 0)
'Add this annotation to a new page.
page.Annotations.Add(documentAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
Constructors
PdfDocumentLinkAnnotation(RectangleF)
Initializes new PdfDocumentLinkAnnotation instance with specified bounds.
Declaration
public PdfDocumentLinkAnnotation(RectangleF rectangle)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.RectangleF | rectangle | The bounds of the annotation. |
Examples
//Create the PDF document
PdfDocument document = new PdfDocument();
//Create a new page.
PdfPage page = document.Pages.Add();
//Create a new rectangle
RectangleF docLinkAnnotationRectangle = new RectangleF(10, 40, 30, 30);
//Create a new document link annotation.
PdfDocumentLinkAnnotation documentAnnotation = new PdfDocumentLinkAnnotation(docLinkAnnotationRectangle);
//Create a new page .
PdfPage page2 = document.Pages.Add();
//Set the pdf destination.
documentAnnotation.Destination = new PdfDestination(page2);
//Set the pdf destination location.
documentAnnotation.Destination.Location = new Point(10, 0);
//Add this annotation to a new page.
page.Annotations.Add(documentAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document
document.Close(true);
'Create the PDF document
Dim document As New PdfDocument()
'Create a new page.
Dim page As PdfPage = document.Pages.Add()
'Create a new rectangle
Dim docLinkAnnotationRectangle As New RectangleF(10, 40, 30, 30)
'Create a new document link annotation.
Dim documentAnnotation As New PdfDocumentLinkAnnotation(docLinkAnnotationRectangle)
'Create a new page .
Dim page2 As PdfPage = document.Pages.Add()
'Set the pdf destination.
documentAnnotation.Destination = New PdfDestination(page2)
'Set the pdf destination location.
documentAnnotation.Destination.Location = New Point(10, 0)
'Add this annotation to a new page.
page.Annotations.Add(documentAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also
PdfDocumentLinkAnnotation(RectangleF, PdfDestination)
Initializes new PdfDocumentLinkAnnotation instance with specified bounds and destination.
Declaration
public PdfDocumentLinkAnnotation(RectangleF rectangle, PdfDestination destination)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.RectangleF | rectangle | The bounds of the annotation. |
PdfDestination | destination | The destination of the annotation. |
Examples
//Create the PDF document
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new rectangle
RectangleF docLinkAnnotationRectangle = new RectangleF(10, 40, 30, 30);
//Create a new page .
PdfPage page2 = document.Pages.Add();
//Create a new pdf destination.
PdfDestination destination = new PdfDestination(page2);
//Create a new document link annotation.
PdfDocumentLinkAnnotation documentAnnotation = new PdfDocumentLinkAnnotation(docLinkAnnotationRectangle, destination);
//Set the annotation text.
documentAnnotation.Text = "Document link annotation";
//Add this annotation to a new page.
page.Annotations.Add(documentAnnotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document.
document.Close(true);
'Create the PDF document
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create a new rectangle
Dim docLinkAnnotationRectangle As New RectangleF(10, 40, 30, 30)
'Create a new page .
Dim page2 As PdfPage = document.Pages.Add()
'Create a new pdf destination.
Dim destination As New PdfDestination(page2)
'Create a new document link annotation.
Dim documentAnnotation As New PdfDocumentLinkAnnotation(docLinkAnnotationRectangle, destination)
'Set the annotation text.
documentAnnotation.Text = "Document link annotation"
'Add this annotation to a new page.
page.Annotations.Add(documentAnnotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also
Properties
Destination
Declaration
public PdfDestination Destination { get; set; }
Property Value
Type | Description |
---|---|
PdfDestination |
Methods
Save()
Saves annotation object.
Declaration
protected override void Save()
Overrides
Implements
System.ComponentModel.INotifyPropertyChanged