C1.Silverlight.Pdf.5 Assembly > C1.Silverlight.Pdf Namespace > C1PdfDocument Class > AddLink Method : AddLink(String,Int32,Rect) Method |
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.
Rect rc = new Rect(50, 50, 100, 15); // RectangleF Font font = new Font("Arial", 10, PdfFontStyle.Underline); // FontStyle _c1pdf.AddLink("http://www.componentone.com", rc); _c1pdf.DrawString("Visit ComponentOne", font, Color.Blue, rc); // Brushes.Blue
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2