Class PdfUriAnnotation
Represents the Uri annotation.
Implements
System.ComponentModel.INotifyPropertyChanged
Inherited Members
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
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
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
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
Uri
Gets or sets the Uri address.
Declaration
public string Uri { get; set; }
Property Value
Type |
---|
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
Methods
Initialize()
Initializes annotation object.
Declaration
protected override void Initialize()
Overrides
Implements
System.ComponentModel.INotifyPropertyChanged