//// This code is part of Document Solutions for PDF .NET demos.// Copyright (c) MESCIUS inc. All rights reserved.//usingSystem.IO;usingSystem.Drawing;usingGrapeCity.Documents.Text;usingGrapeCity.Documents.Pdf;usingGrapeCity.Documents.Pdf.Annotations;usingGrapeCity.Documents.Pdf.Actions; namespaceDsPdfWeb.Demos{// A simple way to create a link to an external URL,// and associate it with a text on a page.publicclassLinkToURL {publicintCreatePDF(Stream stream) {var doc = newGcPdfDocument();var page = doc.NewPage();var g = page.Graphics; // Draw some text that will represent the link:var tf = newTextFormat() { Font = StandardFonts.Times, FontSize = 14 };var tl = g.CreateTextLayout(); tl.MarginAll = 72; tl.Append("Google google on the wall, please tell me all!", tf); tl.PerformLayout(true); g.DrawTextLayout(tl, PointF.Empty); // Add a link associated with the text area: page.Annotations.Add(newLinkAnnotation(tl.ContentRectangle, newActionURI("http://www.google.com"))); // Done: doc.Save(stream);return doc.Pages.Count; } }}