See Also

Link Members  | ceTe.DynamicPDF.PageElements Namespace

Requirements

Namespace: ceTe.DynamicPDF.PageElements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: ceTe.DynamicPDF (in ceTe.DynamicPDF.dll)

Language

Visual Basic

C#

Show All

Represents a link with a destination or action.

For a list of all members of this type, see Link members.

Object Model


Inheritance Hierarchy

System.Object
   ceTe.DynamicPDF.PageElement
      ceTe.DynamicPDF.PageElements.Link

Syntax

[Visual Basic]
Public Class Link    Inherits PageElement    Implements IAnnotationIAreaICoordinate 
[C#]
public class Link : PageElement, IAnnotationIAreaICoordinate 

Remarks

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

Example

The following example will place a label on the PDF then create a link at that location that links to a webpage.

[Visual Basic] 

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
        MyDocument.Pages.Add(MyPage)

        Dim MyText As String = "This is a link to DynamicPDF.com"
        Dim MyFont As Font = Font.Helvetica

        ' Create the link's label
        Dim MyLabel As Label = New Label(MyText, 50, 50, 400, 20, MyFont, 18, _
            RgbColor.Blue)
        MyLabel.Underline = True

        ' Set the action then create the link
        Dim action As UrlAction = New UrlAction("http://www.dynamicpdf.com")
        Dim MyLink As Link = New Link(50, 50, MyFont.GetTextWidth(MyText, 18), _
            20, Action)

        ' Add the label and the link to the page
        MyPage.Elements.Add(MyLabel)
        MyPage.Elements.Add(MyLink)

        ' Save the PDF
        MyDocument.Draw("C:\MyDocument.pdf")

    End Sub
End Module

[C#] 

using System; 
using ceTe.DynamicPDF; 
using ceTe.DynamicPDF.PageElements; 
 
class MyClass 

    static void Main() 
    { 
        // 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 DynamicPDF.com"; 
        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( "http://www.dynamicpdf.com" ); 
        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( @"C:\MyDocument.pdf" ); 
    } 
}

Licensing

This class is a DynamicPDF Generator Professional Edition feature. One of the following licenses is required for non-evaluation usage:

Requirements

Namespace: ceTe.DynamicPDF.PageElements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: ceTe.DynamicPDF (in ceTe.DynamicPDF.dll)

See Also

Link Members  | ceTe.DynamicPDF.PageElements Namespace

 

 


© Copyright 2006, ceTe Software