Xamarin.Android

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

    Show / Hide Table of Contents

    Class PdfUriAnnotation

    Represents the Uri annotation.

    Inheritance
    System.Object
    PdfAnnotation
    PdfLinkAnnotation
    PdfActionLinkAnnotation
    PdfUriAnnotation
    Implements
    System.ComponentModel.INotifyPropertyChanged
    Inherited Members
    PdfLinkAnnotation.HighlightMode
    PdfAnnotation.SetAppearance(Boolean)
    PdfAnnotation.Save()
    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 PdfUriAnnotation : PdfActionLinkAnnotation, IPdfWrapper, INotifyPropertyChanged
    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 Uri Annotation.
    PdfUriAnnotation uriAnnotation = new PdfUriAnnotation(rectangle, "http://www.google.com");
    //Set Text to uriAnnotation.
    uriAnnotation.Text = "Uri Annotation";
    //Add this annotation to a new page.
    page.Annotations.Add(uriAnnotation);
    //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 Uri Annotation.
    Dim uriAnnotation As New PdfUriAnnotation(rectangle, "http://www.google.com")
    'Set Text to uriAnnotation.
    uriAnnotation.Text = "Uri Annotation"
    'Add this annotation to a new page.
    page.Annotations.Add(uriAnnotation)
    'Save the document to disk.
    document.Save("Output.pdf")
    'close the document
    document.Close(True)

    Constructors

    PdfUriAnnotation(RectangleF)

    Initializes a new instance of the PdfUriAnnotation class with specified bounds.

    Declaration
    public PdfUriAnnotation(RectangleF rectangle)
    Parameters
    Type Name Description
    RectangleF rectangle

    RectangleF structure that specifies the bounds of the annotation.

    Examples
    //Create a new PDF document.
    PdfDocument document = new PdfDocument();
    //Creates a new page and adds it as the last page of the document
    PdfPage page = document.Pages.Add();
    //Create a new rectangle
    RectangleF rectangle = new RectangleF(10, 40, 30, 30);
    //Create a new Uri Annotation.
    PdfUriAnnotation uriAnnotation = new PdfUriAnnotation(rectangle);
    //Set Text to uriAnnotation.
    uriAnnotation.Text = "Uri Annotation";
    // Set Uri to uriAnnotation
    uriAnnotation.Uri = "http://www.google.com";
    //Add this annotation to a new page.
    page.Annotations.Add(uriAnnotation);
    //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()
    '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 New RectangleF(10, 40, 30, 30)
    'Create a new Uri Annotation.
    Dim uriAnnotation As New PdfUriAnnotation(rectangle)
    'Set Text to uriAnnotation.
    uriAnnotation.Text = "Uri Annotation"
    ' Set Uri to uriAnnotation
    uriAnnotation.Uri = "http://www.google.com"
    'Add this annotation to a new page.
    page.Annotations.Add(uriAnnotation)
    'Save the document to disk.
    document.Save("Output.pdf")
    'close the document
    document.Close(True)
    See Also
    PdfDocument
    PdfPage

    PdfUriAnnotation(RectangleF, String)

    Initializes a new instance of the PdfUriAnnotation class with specified bounds and Uri.

    Declaration
    public PdfUriAnnotation(RectangleF rectangle, string uri)
    Parameters
    Type Name Description
    RectangleF rectangle

    RectangleF structure that specifies the bounds of the annotation.

    System.String uri

    unique resource identifier path.

    Examples
    //Create a new PDF document.
    PdfDocument document = new PdfDocument();
    //Creates a new page 
    PdfPage page = document.Pages.Add();
    //Create a new rectangle
    RectangleF rectangle = new RectangleF(10, 40, 30, 30);
    //Create a new Uri Annotation.
    PdfUriAnnotation uriAnnotation = new PdfUriAnnotation(rectangle, "http://www.google.com");
    //Set Text to uriAnnotation.
    uriAnnotation.Text = "Uri Annotation";
    //Add this annotation to a new page.
    page.Annotations.Add(uriAnnotation);
    //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()
    'Creates 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 Uri Annotation.
    Dim uriAnnotation As New PdfUriAnnotation(rectangle, "http://www.google.com")
    'Set Text to uriAnnotation.
    uriAnnotation.Text = "Uri Annotation"
    'Add this annotation to a new page.
    page.Annotations.Add(uriAnnotation)
    'Save the document to disk.
    document.Save("Output.pdf")
    'close the document
    document.Close(True)
    See Also
    PdfDocument
    PdfPage

    Properties

    Action

    Gets or sets the action.

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

    The PdfAction object specifies the action of the annotation.

    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 Uri Annotation.
    PdfUriAnnotation uriAnnotation = new PdfUriAnnotation(rectangle);
    //Set Text to uriAnnotation.
    uriAnnotation.Text = "Uri Annotation";
    // Set Uri to uriAnnotation
    uriAnnotation.Uri = "http://www.google.com";
    //Creates a new Sound action
    PdfSoundAction soundAction = new PdfSoundAction(@"Input.wav");
    soundAction.Sound.Bits = 16;
    soundAction.Sound.Channels = PdfSoundChannels.Stereo;
    soundAction.Sound.Encoding = PdfSoundEncoding.Signed;
    soundAction.Volume = 0.9f;
    uriAnnotation.Action = soundAction;
    //Add this annotation to a new page.
    page.Annotations.Add(uriAnnotation);
    //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 Uri Annotation.
    Dim uriAnnotation As New PdfUriAnnotation(rectangle)
    'Set Text to uriAnnotation.
    uriAnnotation.Text = "Uri Annotation"
    ' Set Uri to uriAnnotation
    uriAnnotation.Uri = "http://www.google.com"
    'Creates a new Sound action
    Dim soundAction As New PdfSoundAction("Input.wav")
    soundAction.Sound.Bits = 16
    soundAction.Sound.Channels = PdfSoundChannels.Stereo
    soundAction.Sound.Encoding = PdfSoundEncoding.Signed
    soundAction.Volume = 0.9f
    uriAnnotation.Action = soundAction
    'Add this annotation to a new page.
    page.Annotations.Add(uriAnnotation)
    'Save the document to disk.
    document.Save("Output.pdf")
    'close the document
    document.Close(True)
    See Also
    PdfDocument
    PdfPage

    Uri

    Gets or sets the Uri address.

    Declaration
    public string Uri { get; set; }
    Property Value
    Type Description
    System.String
    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 Uri Annotation.
    PdfUriAnnotation uriAnnotation = new PdfUriAnnotation(rectangle);
    // Set Uri to uriAnnotation
    uriAnnotation.Uri = "http://www.google.com";
    //Set Text to uriAnnotation.
    uriAnnotation.Text = "Uri Annotation";
    //Add this annotation to a new page.
    page.Annotations.Add(uriAnnotation);
    //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 Uri Annotation.
    Dim uriAnnotation As New PdfUriAnnotation(rectangle)
    'Set Uri to uriAnnotation
    uriAnnotation.Uri = "http://www.google.com"
    'Set Text to uriAnnotation.
    uriAnnotation.Text = "Uri Annotation"
    'Add this annotation to a new page.
    page.Annotations.Add(uriAnnotation)
    'Save the document to disk.
    document.Save("Output.pdf")
    'close the document
    document.Close(True)
    See Also
    PdfDocument
    PdfPage

    Methods

    Initialize()

    Initializes annotation object.

    Declaration
    protected override void Initialize()
    Overrides
    PdfLinkAnnotation.Initialize()

    Implements

    System.ComponentModel.INotifyPropertyChanged

    See Also

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