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
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.
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.
public string Url { get; set; }
Property Value
- 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
public void DrawTextWebLink(PdfGraphics graphics, PointF location)
Parameters
graphics
PdfGraphicslocation
PointFThe 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
public PdfLayoutResult DrawTextWebLink(PdfPage page, PointF location)
Parameters
page
PdfPageThe page where the annotation should be placed.
location
PointFThe location of the annotation.
Returns
- 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")
- See Also