Class PdfTextWebLink
Represents the class for text web link annotation.
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Syncfusion.Pdf.Interactive
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class PdfTextWebLink : PdfTextElement
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new solid brush
PdfBrush brush = new PdfSolidBrush(Color.Black);
//Set the font
float fontSize = 10f;
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, fontSize);
//Create a text web link annotation
PdfTextWebLink webLinkAnnotation = new PdfTextWebLink();
webLinkAnnotation.Url = "http://www.yahoo.com";
webLinkAnnotation.Text = "Yahoo Mail";
webLinkAnnotation.Brush = brush;
webLinkAnnotation.Font = font;
webLinkAnnotation.Pen = PdfPens.Brown;
webLinkAnnotation.DrawTextWebLink(page, new PointF(50, 40));
page.Graphics.DrawString("Go to Yahoo Web Site", font, brush, new PointF(110, 40));
//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 solid brush
Dim brush As PdfBrush = New PdfSolidBrush(Color.Black)
'Set the font
Dim fontSize As Single = 10f
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, fontSize)
'Create a text web link annotation
Dim webLinkAnnotation As New PdfTextWebLink()
webLinkAnnotation.Url = "http://www.yahoo.com"
webLinkAnnotation.Text = "Yahoo Mail"
webLinkAnnotation.Brush = brush
webLinkAnnotation.Font = font
webLinkAnnotation.Pen = PdfPens.Brown
webLinkAnnotation.DrawTextWebLink(page, New PointF(50, 40))
page.Graphics.DrawString("Go to Yahoo Web Site", font, brush, New PointF(110, 40))
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
Constructors
PdfTextWebLink()
Initializes a new instance of the PdfTextWebLink class.
Declaration
public PdfTextWebLink()
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new solid brush
PdfBrush brush = new PdfSolidBrush(Color.Black);
//Set the font
float fontSize = 10f;
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, fontSize);
//Create a text web link annotation
PdfTextWebLink webLinkAnnotation = new PdfTextWebLink();
webLinkAnnotation.Url = "http://www.yahoo.com";
webLinkAnnotation.Text = "Yahoo Mail";
webLinkAnnotation.Brush = brush;
webLinkAnnotation.Font = font;
webLinkAnnotation.Pen = PdfPens.Brown;
webLinkAnnotation.DrawTextWebLink(page, new PointF(50, 40));
page.Graphics.DrawString("Go to Yahoo Web Site", font, brush, new PointF(110, 40));
//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 solid brush
Dim brush As PdfBrush = New PdfSolidBrush(Color.Black)
'Set the font
Dim fontSize As Single = 10f
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, fontSize)
'Create a text web link annotation
Dim webLinkAnnotation As New PdfTextWebLink()
webLinkAnnotation.Url = "http://www.yahoo.com"
webLinkAnnotation.Text = "Yahoo Mail"
webLinkAnnotation.Brush = brush
webLinkAnnotation.Font = font
webLinkAnnotation.Pen = PdfPens.Brown
webLinkAnnotation.DrawTextWebLink(page, New PointF(50, 40))
page.Graphics.DrawString("Go to Yahoo Web Site", font, brush, New PointF(110, 40))
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also
Properties
Url
Gets or sets the Uri address.
Declaration
public string Url { get; set; }
Property Value
Type | Description |
---|---|
System.String | The string value which contains the Uri address. |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new solid brush
PdfBrush brush = new PdfSolidBrush(Color.Black);
//Set the font
float fontSize = 10f;
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, fontSize);
//Create a text web link annotation
PdfTextWebLink webLinkAnnotation = new PdfTextWebLink();
webLinkAnnotation.Url = "http://www.yahoo.com";
webLinkAnnotation.Text = "Yahoo Mail";
webLinkAnnotation.Brush = brush;
webLinkAnnotation.Font = font;
webLinkAnnotation.Pen = PdfPens.Brown;
webLinkAnnotation.DrawTextWebLink(page, new PointF(50, 40));
page.Graphics.DrawString("Go to Yahoo Web Site", font, brush, new PointF(110, 40));
//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 solid brush
Dim brush As PdfBrush = New PdfSolidBrush(Color.Black)
'Set the font
Dim fontSize As Single = 10f
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, fontSize)
'Create a text weblink annotation
Dim webLinkAnnotation As New PdfTextWebLink()
webLinkAnnotation.Url = "http://www.yahoo.com"
webLinkAnnotation.Text = "Yagoo Mail"
webLinkAnnotation.Brush = brush
webLinkAnnotation.Font = font
webLinkAnnotation.Pen = PdfPens.Brown
webLinkAnnotation.DrawTextWebLink(page, New PointF(50, 40))
page.Graphics.DrawString("Go to Yahoo Web Site", font, brush, New PointF(110, 40))
'Save the document to disk.
document.Save("Output.pdf")
'close the document
document.Close(True)
See Also
Methods
DrawTextWebLink(PdfGraphics, PointF)
Draw a Text Web Link on the Graphics
Declaration
public void DrawTextWebLink(PdfGraphics graphics, PointF location)
Parameters
Type | Name | Description |
---|---|---|
PdfGraphics | graphics | |
System.Drawing.PointF | location | The location of the annotation. |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new solid brush
PdfBrush brush = new PdfSolidBrush(Color.Black);
//Set the font
float fontSize = 10f;
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, fontSize);
//Create a text weblink annotation
PdfTextWebLink webLinkAnnotation = new PdfTextWebLink();
webLinkAnnotation.Url = "http://www.yahoo.com";
webLinkAnnotation.Text = "Yagoo Mail";
webLinkAnnotation.Brush = brush;
webLinkAnnotation.Font = font;
webLinkAnnotation.Pen = PdfPens.Brown;
webLinkAnnotation.DrawTextWebLink(page.Graphics, new PointF(50, 40));
page.Graphics.DrawString("Go to Yahoo Web Site", font, brush, new PointF(110, 40));
//Add this annotation to a new page.
page.Annotations.Add(webLinkAnnotation);
//Save the document to disk.
document.Save("TextWebLink(.pdf");
'Create a new PDF document.
Dim document As PdfDocument = New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create a new solid brush
Dim brush As PdfBrush = New PdfSolidBrush(Color.Black)
'Set the font
Dim fontSize As Single = 10f
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, fontSize)
'Create a text weblink annotation
Dim webLinkAnnotation As PdfTextWebLink = New PdfTextWebLink()
webLinkAnnotation.Url = "http://www.yahoo.com"
webLinkAnnotation.Text = "Yagoo Mail"
webLinkAnnotation.Brush = brush
webLinkAnnotation.Font = font
webLinkAnnotation.Pen = PdfPens.Brown
webLinkAnnotation.DrawTextWebLink(page.Graphics, new PointF(50, 40))
page.Graphics.DrawString("Go to Yahoo Web Site", font, brush, new PointF(110, 40))
'Add this annotation to a new page.
page.Annotations.Add(webLinkAnnotation)
'Save the document to disk.
document.Save("TextWebLink(.pdf")
See Also
DrawTextWebLink(PdfPage, PointF)
Draws a Text Web Link on the Page
Declaration
public PdfLayoutResult DrawTextWebLink(PdfPage page, PointF location)
Parameters
Type | Name | Description |
---|---|---|
PdfPage | page | The page where the annotation should be placed. |
System.Drawing.PointF | location | The location of the annotation. |
Returns
Type | Description |
---|---|
PdfLayoutResult | Pdf Layout result |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new solid brush
PdfBrush brush = new PdfSolidBrush(Color.Black);
//Set the font
float fontSize = 10f;
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, fontSize);
//Create a text weblink annotation
PdfTextWebLink webLinkAnnotation = new PdfTextWebLink();
webLinkAnnotation.Url = "http://www.yahoo.com";
webLinkAnnotation.Text = "Yagoo Mail";
webLinkAnnotation.Brush = brush;
webLinkAnnotation.Font = font;
webLinkAnnotation.Pen = PdfPens.Brown;
webLinkAnnotation.DrawTextWebLink(page, new PointF(50, 40));
page.Graphics.DrawString("Go to Yahoo Web Site", font, brush, new PointF(110, 40));
//Add this annotation to a new page.
page.Annotations.Add(webLinkAnnotation);
//Save the document to disk.
document.Save("TextWebLink(.pdf");
'Create a new PDF document.
Dim document As PdfDocument = New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create a new solid brush
Dim brush As PdfBrush = New PdfSolidBrush(Color.Black)
'Set the font
Dim fontSize As Single = 10f
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, fontSize)
'Create a text weblink annotation
Dim webLinkAnnotation As PdfTextWebLink = New PdfTextWebLink()
webLinkAnnotation.Url = "http://www.yahoo.com"
webLinkAnnotation.Text = "Yagoo Mail"
webLinkAnnotation.Brush = brush
webLinkAnnotation.Font = font
webLinkAnnotation.Pen = PdfPens.Brown
webLinkAnnotation.DrawTextWebLink(page, new PointF(50, 40))
page.Graphics.DrawString("Go to Yahoo Web Site", font, brush, new PointF(110, 40))
'Add this annotation to a new page.
page.Annotations.Add(webLinkAnnotation)
'Save the document to disk.
document.Save("TextWebLink(.pdf")