Table of Contents

Class PdfTextWebLink

Namespace
Syncfusion.Pdf.Interactive
Assembly
Syncfusion.Pdf.Portable.dll

Represents the class for text web link annotation.

public class PdfTextWebLink : PdfTextElement
Inheritance
PdfTextWebLink
Inherited Members
//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

Initializes a new instance of the PdfTextWebLink class.

public PdfTextWebLink()
//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

Gets or sets the Uri address.

public string Url { get; set; }

Property Value

string

The string value which contains the Uri address.

//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

Draw a Text Web Link on the Graphics

public void DrawTextWebLink(PdfGraphics graphics, PointF location)

Parameters

graphics PdfGraphics
location PointF

The location of the annotation.

//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

Draws a Text Web Link on the Page

public PdfLayoutResult DrawTextWebLink(PdfPage page, PointF location)

Parameters

page PdfPage

The page where the annotation should be placed.

location PointF

The location of the annotation.

Returns

PdfLayoutResult

Pdf Layout result

//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")
See Also

See Also