Xamarin.Android

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfDocumentLinkAnnotation

    Show / Hide Table of Contents

    Class PdfDocumentLinkAnnotation

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

    Inheritance
    System.Object
    PdfAnnotation
    PdfLinkAnnotation
    PdfDocumentLinkAnnotation
    Implements
    System.ComponentModel.INotifyPropertyChanged
    Inherited Members
    PdfLinkAnnotation.Initialize()
    PdfLinkAnnotation.HighlightMode
    PdfAnnotation.SetAppearance(Boolean)
    PdfAnnotation.CalculateBounds(RectangleF, PdfPage, PdfLoadedPage)
    PdfAnnotation.SetValues(String, String)
    PdfAnnotation.CalculateTemplateBounds(RectangleF, PdfPageBase, PdfTemplate)
    PdfAnnotation.CalculateTemplateBounds(RectangleF, PdfPageBase, PdfTemplate, Boolean, PdfGraphics)
    PdfAnnotation.CalculateTemplateBounds(RectangleF, PdfPageBase, PdfTemplate, Boolean)
    PdfAnnotation.CheckFlatten()
    PdfAnnotation.Color
    PdfAnnotation.Opacity
    PdfAnnotation.InnerColor
    PdfAnnotation.Border
    PdfAnnotation.Bounds
    PdfAnnotation.Location
    PdfAnnotation.Size
    PdfAnnotation.Page
    PdfAnnotation.Text
    PdfAnnotation.Author
    PdfAnnotation.Subject
    PdfAnnotation.ModifiedDate
    PdfAnnotation.AnnotationFlags
    PdfAnnotation.Flatten
    PdfAnnotation.FlattenPopUps
    PdfAnnotation.PdfTag
    PdfAnnotation.Layer
    PdfAnnotation.Rotate
    PdfAnnotation.Name
    PdfAnnotation.PropertyChanged
    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 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
    PdfDocument
    PdfPage

    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
    PdfDocument
    PdfPage

    Properties

    Destination

    Declaration
    public PdfDestination Destination { get; set; }
    Property Value
    Type Description
    PdfDestination

    Methods

    Save()

    Saves annotation object.

    Declaration
    protected override void Save()
    Overrides
    PdfAnnotation.Save()

    Implements

    System.ComponentModel.INotifyPropertyChanged

    See Also

    PdfDocument
    PdfPage
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved