Class PdfUriAnnotation
- Namespace
- Syncfusion.Pdf.Interactive
- Assembly
- Syncfusion.Pdf.Portable.dll
Represents the Uri annotation.
public class PdfUriAnnotation : PdfActionLinkAnnotation, INotifyPropertyChanged
- Inheritance
-
PdfUriAnnotation
- Implements
- Inherited Members
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.
public PdfUriAnnotation(RectangleF rectangle)
Parameters
rectangle
RectangleFRectangleF 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.
public PdfUriAnnotation(RectangleF rectangle, string uri)
Parameters
rectangle
RectangleFRectangleF structure that specifies the bounds of the annotation.
uri
stringunique 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.
public override PdfAction Action { get; set; }
Property Value
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.
public string Uri { get; set; }
Property Value
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.
protected override void Initialize()
- See Also