Class PdfDocumentLinkAnnotation
Represents an annotation object with holds link on another location within a document.
Implements
System.ComponentModel.INotifyPropertyChanged
Inherited Members
Namespace: Syncfusion.Pdf.Interactive
Assembly: Syncfusion.Pdf.Portable.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 https://help.syncfusion.com/file-formats/pdf/working-with-annotations#document-link-annotation for more details.
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 |
---|---|---|
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 |
---|---|---|
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
Gets or sets the destination of the annotation.
Declaration
public PdfDestination Destination { get; set; }
Property Value
Type | Description |
---|---|
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.
Declaration
protected override void Save()
Overrides
Implements
System.ComponentModel.INotifyPropertyChanged