Xamarin.Android

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

    Show / Hide Table of Contents

    Class PdfFileLinkAnnotation

    Represents the annotation link to an external file.

    Inheritance
    System.Object
    PdfAnnotation
    PdfLinkAnnotation
    PdfActionLinkAnnotation
    PdfFileLinkAnnotation
    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 PdfFileLinkAnnotation : PdfActionLinkAnnotation, IPdfWrapper, INotifyPropertyChanged
    Remarks

    This PdfFileLinkAnnotation class is used to link the external file to PDF document. Please refer the UG docuemntation link for more details.

    Examples
    //Create a PDF document.
    PdfDocument document = new PdfDocument();
    //Create a new page.
    PdfPage page = document.Pages.Add();
    //Create a new rectangle
    RectangleF rectangle = new RectangleF(10, 40, 30, 30);
    //Create a new PDF file link annotation.
    PdfFileLinkAnnotation fileLinkAnnotation = new PdfFileLinkAnnotation(rectangle, @"Input.png");
    //Add this annotation to a new page.
    page.Annotations.Add(fileLinkAnnotation);
    //Save the document to disk.
    document.Save("Output.pdf");
    //close the document
    document.Close(true);
    'Create a PDF document.
    Dim document As New PdfDocument()
    'Create a new page.
    Dim page As PdfPage = document.Pages.Add()
    'Create a new rectangle
    Dim rectangle As New RectangleF(10, 40, 30, 30)
    'Create a new PDF file link annotation.
    Dim fileLinkAnnotation As New PdfFileLinkAnnotation(rectangle, "Input.png")
    'Add this annotation to a new page.
    page.Annotations.Add(fileLinkAnnotation)
    'Save the document to disk.
    document.Save("Output.pdf")
    'close the document
    document.Close(True)

    Constructors

    PdfFileLinkAnnotation(RectangleF, String)

    Declaration
    public PdfFileLinkAnnotation(RectangleF rectangle, string fileName)
    Parameters
    Type Name Description
    RectangleF rectangle

    The bounds of the annotation.

    System.String fileName

    A string value specifying the full path to the file to be embedded.

    Examples
    //Create a PDF document.
    PdfDocument document = new PdfDocument();
    //Create a new page.
    PdfPage page = document.Pages.Add();
    //Create a new rectangle
    RectangleF rectangle = new RectangleF(10, 40, 30, 30);
    //Create a new pdf file link annotation.
    PdfFileLinkAnnotation fileLinkAnnotation = new PdfFileLinkAnnotation(rectangle, @"Input.png");
    //Add this annotation to a new page.
    page.Annotations.Add(fileLinkAnnotation);
    //Save the document to disk.
    document.Save("Output.pdf");
    //close the document
    document.Close(true); 
    'Create a PDF document.
    Dim document As New PdfDocument()
    'Create a new page.
    Dim page As PdfPage = document.Pages.Add()
    'Create a new rectangle
    Dim rectangle As New RectangleF(10, 40, 30, 30)
    'Create a new pdf file link annotation.
    Dim fileLinkAnnotation As New PdfFileLinkAnnotation(rectangle, "Input.png")
    'Add this annotation to a new page.
    page.Annotations.Add(fileLinkAnnotation)
    'Save the document to disk.
    document.Save("Output.pdf")
    'close the document
    document.Close(True)
    See Also
    PdfPage

    Properties

    Action

    Gets or sets the action.

    Declaration
    public override PdfAction Action { get; set; }
    Property Value
    Type Description
    PdfAction

    The action to be executed when the annotation is activated.

    Overrides
    PdfActionLinkAnnotation.Action
    Examples
    //Create a new PDF document.
    PdfDocument document = new PdfDocument();
    //Create a new page
    PdfPage page = document.Pages.Add();
    //Create a new rectangle
    RectangleF rectangle = new RectangleF(10, 40, 30, 30);
    //Create a new file link annotation.
    PdfFileLinkAnnotation fileLinkAnnotation = new PdfFileLinkAnnotation(rectangle, "input.png");
    //Set an action to file link annotation.
    PdfJavaScriptAction javaAction = new PdfJavaScriptAction("app.alert(\"You are looking at Java script action of PDF \")");
    fileLinkAnnotation.Action = javaAction;
    //Add this annotation to a new page.
    page.Annotations.Add(fileLinkAnnotation);
    //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 rectangle As New RectangleF(10, 40, 30, 30)
    'Create a new file link annotation.
    Dim fileLinkAnnotation As New PdfFileLinkAnnotation(rectangle, "input.png")
    'Set an action to file link annotation.
    Dim javaAction As New PdfJavaScriptAction("app.alert(""You are looking at Java script action of PDF "")")
    fileLinkAnnotation.Action = javaAction
    'Add this annotation to a new page.
    page.Annotations.Add(fileLinkAnnotation)
    'Save the document to disk.
    document.Save("Output.pdf")
    'close the document
    document.Close(True)
    See Also
    PdfPage

    FileName

    Declaration
    public string FileName { get; set; }
    Property Value
    Type Description
    System.String

    A string value specifying the full path to the file to be embedded.

    Examples
    //Create a PDF document.
    PdfDocument document = new PdfDocument();
    //Create a new page.
    PdfPage page = document.Pages.Add();
    //Create a new rectangle
    RectangleF rectangle = new RectangleF(10, 40, 30, 30);
    //Create a new PDF file link annotation.
    PdfFileLinkAnnotation fileLinkAnnotation = new PdfFileLinkAnnotation(rectangle, @"Input.png");
    //Get the file name.
    string fileName = fileLinkAnnotation.FileName;
    //Add this annotation to a new page.
    page.Annotations.Add(fileLinkAnnotation);
    //Save the document to disk.
    document.Save("Output.pdf");
    //close the document
    document.Close(true);
    'Create a new PDF document.
    Dim document As PdfDocument = New PdfDocument()
    'Creates a new page and adds it as the last page of the document
    Dim page As PdfPage = document.Pages.Add()
    'Create a new rectangle
    Dim rectangle As RectangleF = New RectangleF(10, 40, 30, 30)
    'Create a new PDF file link annotation.
    Dim fileLinkAnnotation As PdfFileLinkAnnotation = New PdfFileLinkAnnotation(rectangle, "Input.png")
    'Gets the file name.
    Dim fileName As String=fileLinkAnnotation.FileName
    'Add this annotation to a new page.
    page.Annotations.Add(fileLinkAnnotation)
    'Save the document to disk.
    document.Save("Output.pdf")
     'close the document
    document.Close(true);
    See Also
    PdfPage

    Methods

    Save()

    Saves annotation object.

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

    Implements

    System.ComponentModel.INotifyPropertyChanged

    See Also

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