Xamarin.Android

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfTextWebLink

    Show / Hide Table of Contents

    Class PdfTextWebLink

    Represents the class for text web link annotation.

    Inheritance
    System.Object
    PdfGraphicsElement
    PdfLayoutElement
    PdfTextElement
    PdfTextWebLink
    Inherited Members
    PdfTextElement.Draw(PdfPage, PointF, PdfLayoutFormat)
    PdfTextElement.Draw(PdfPage, PointF, Single, PdfLayoutFormat)
    PdfTextElement.Draw(PdfPage, RectangleF, PdfLayoutFormat)
    PdfTextElement.Layout(PdfLayoutParams)
    PdfTextElement.Text
    PdfTextElement.Pen
    PdfTextElement.Brush
    PdfTextElement.Font
    PdfTextElement.StringFormat
    PdfLayoutElement.add_EndPageLayout(EndPageLayoutEventHandler)
    PdfLayoutElement.remove_EndPageLayout(EndPageLayoutEventHandler)
    PdfLayoutElement.add_BeginPageLayout(BeginPageLayoutEventHandler)
    PdfLayoutElement.remove_BeginPageLayout(BeginPageLayoutEventHandler)
    PdfLayoutElement.Draw(PdfPage, PointF)
    PdfLayoutElement.Draw(PdfPage, Single, Single)
    PdfLayoutElement.Draw(PdfPage, RectangleF)
    PdfLayoutElement.Draw(PdfPage, Single, Single, PdfLayoutFormat)
    PdfLayoutElement.Layout(HtmlToPdfLayoutParams)
    PdfLayoutElement.PdfTag
    PdfLayoutElement.EndPageLayout
    PdfLayoutElement.BeginPageLayout
    PdfGraphicsElement.Draw(PdfGraphics)
    PdfGraphicsElement.Draw(PdfGraphics, PointF)
    PdfGraphicsElement.Draw(PdfGraphics, Single, Single)
    Namespace: Syncfusion.Pdf.Interactive
    Assembly: Syncfusion.Pdf.Portable.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
    PdfDocument
    PdfPage
    PdfFont

    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
    PdfDocument
    PdfPage
    PdfFont

    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
    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
    PdfDocument
    PdfPage
    PdfFont

    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.

    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")
    See Also
    PdfDocument
    PdfPage
    PdfFont

    See Also

    PdfDocument
    PdfPage
    PdfFont
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved