ComponentOne PDF for .NET
AddLink(String,Int32,RectangleF) Method
Example 

C1.C1Pdf.4 Assembly > C1.C1Pdf Namespace > C1PdfDocument Class > AddLink Method : AddLink(String,Int32,RectangleF) Method
Link destination (can be a Url, a file name, or a local link destination).
Index of the page that contains the hyperlink
Area on the page that will behave as a link (expressed in points, from the top-left corner of the page).
Adds a hyperlink to the document.
Syntax
'Declaration
 
Public Overloads Sub AddLink( _
   ByVal url As System.String, _
   ByVal page As System.Integer, _
   ByVal rc As System.Drawing.RectangleF _
) 
public void AddLink( 
   System.string url,
   System.int page,
   System.Drawing.RectangleF rc
)

Parameters

url
Link destination (can be a Url, a file name, or a local link destination).
page
Index of the page that contains the hyperlink
rc
Area on the page that will behave as a link (expressed in points, from the top-left corner of the page).
Remarks

Hyperlinks can be external (Urls and file names) or local (other locations within the same document).

Local links are useful when you want to implement some type of cross-referencing within the document, such as a table of contents or an index. Local links are identical to regular hyperlinks, except for two things:

1) The url parameter must start with a "#", and

2) You must specify the target location for the link using the AddTarget method.

Note that the AddLink method does not add any visible content to the page, so you will usually need another command along with AddLink to specify some text or an image that the user can see, as the example below demonstrates.

Example
The code below adds a string that says "Visit GrapeCity" and a link that takes the user to the ComponentOne home page:
Rect rc = new Rect(50, 50, 100, 15);                            // RectangleF
Font font = new Font("Arial", 10, PdfFontStyle.Underline);      // FontStyle
_c1pdf.AddLink("http://www.grapecity.com", rc);
_c1pdf.DrawString("Visit GrapeCity", font, Color.Blue, rc);  // Brushes.Blue
See Also

Reference

C1PdfDocument Class
C1PdfDocument Members
Overload List