Represents a link with a destination or action.

public class Link : TaggablePageElement, IAnnotation, IArea, ICoordinate, ISerializable
Public Class Link
    Inherits TaggablePageElement
    Implements IAnnotation, IArea, ICoordinate, ISerializable

Inheritance: ObjectPageElementTaggablePageElementLink

Implements: IAnnotation, IArea, ICoordinate, ISerializable

Derived: AutoLink

Licensing Info

This class is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:


The following example will place a label on the PDF then create a link at that location that links to a webpage.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModule
    Sub Main()
        ' Create a PDF Document
        Dim MyDocument As Document = New Document 
        ' Create a Page and add it to the document
        Dim MyPage As Page = New Page
        Dim MyText As String = "This is a link to"
        Dim MyFont As Font = Font.Helvetica
        ' Create the link's label
        Dim MyLabel As Label = New Label(MyText, 50, 50, 400, 20, MyFont, 18, _
        MyLabel.Underline = True
        ' Set the action then create the link
        Dim action As UrlAction = New UrlAction("")
        Dim MyLink As Link = New Link(50, 50, MyFont.GetTextWidth(MyText, 18), _
     	20, Action)
        ' Add the label and the link to the page
        ' Save the PDF
    End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;

public class Example
    public static void CreatePDF(string outputPath)
        // Create a PDF Document
        Document document = new Document();

        // Create a Page and add it to the document
        Page page = new Page();
        document.Pages.Add( page );

        string text = "This is a link to";
        Font font = Font.Helvetica;

        // Create the link's label
        Label label = new Label( text, 50, 50, 400, 20, font, 18, 
			RgbColor.Blue );
        label.Underline = true;

        // Set the action then create the link
        UrlAction action = new UrlAction( "" );
        Link link = new Link( 50, 50, font.GetTextWidth( text, 18 ), 20, 
			action );

        // Add the label and the link to the page
        page.Elements.Add( label );
        page.Elements.Add( link );

        // Save the PDF
        document.Draw( outputPath );


This class can be used to place links on the PDF.

NOTE: This page element cannot be used within a table cell, or transformation group.


Link(Single, Single, Single, Single, Action)Initializes a new instance of the Link class.


ActionGets the Action to be taken by the link.
AlternateDescriptionGets or sets the alternate description of the link.
HeightGets or sets the height of the link.
IDGets or sets the ID of the page element.
(Inherited from PageElement)
IgnoreMarginsGets or sets ignore margin property. Setting false will consider the margin while placing the page element based on the RelativeTo property.
(Inherited from PageElement)
RelativeToGets and sets placement of the page element on the page.
(Inherited from PageElement)
TagGets or sets the structure element of the link.
TagOrderGets or sets the tag order of the taggable element.
(Inherited from TaggablePageElement)
WidthGets or sets the width of the link.
XGets or sets the X coordinate of the link.
YGets or sets the Y coordinate of the link.


Draw(PageWriter)Draws the link to the given PageWriter object.
DrawAnnotation(DocumentWriter)Draws the link to the given DocumentWriter object.
Equals(Object)Determines whether the specified Object is equal to the current Object .
(Inherited from Object)
GetHashCode()Serves as a hash function for a particular type.
(Inherited from Object)
GetType()Gets the Type of the current instance.
(Inherited from Object)
ToString()Returns a String that represents the current Object .
(Inherited from Object)

See Also


In this topic