Table of Contents

Class PdfDocumentLinkAnnotation

Namespace
Syncfusion.Pdf.Interactive
Assembly
Syncfusion.Pdf.Portable.dll

Represents an annotation object with holds link on another location within a document.

public class PdfDocumentLinkAnnotation : PdfLinkAnnotation, INotifyPropertyChanged
Inheritance
PdfDocumentLinkAnnotation
Implements
Inherited Members

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)

Remarks

This PdfDocumentLinkAnnotation class is used to navigate the specific destination within the document. Please refer the UG docuemntation link for more details.

Constructors

PdfDocumentLinkAnnotation(RectangleF)

Initializes new PdfDocumentLinkAnnotation instance with specified bounds.

public PdfDocumentLinkAnnotation(RectangleF rectangle)

Parameters

rectangle RectangleF

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.

public PdfDocumentLinkAnnotation(RectangleF rectangle, PdfDestination destination)

Parameters

rectangle RectangleF

The bounds of the annotation.

destination PdfDestination

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

Gets or sets the destination of the annotation.

public PdfDestination Destination { get; set; }

Property Value

PdfDestination

The PdfDestination object specifies which page to be navigated.

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

Methods

Save()

Saves annotation object.

protected override void Save()
See Also

See Also