How to create text in PDF using the TextOut MethodThe code sample below creates a PDF document with a URL on it. c# sample: PDFDocument doc = new PDFDocument("sample.pdf"); doc.CurrentPage.Body.SetActiveFont("Arial", PDFFontStyles.Underline, 12, Charset.ANSI_CHARSET, Color.Blue); doc.CurrentPage.Body.TextOut(10, 10, 0, "Please visit us."); float width = (float)doc.CurrentPage.Body.GetTextWidth("Please visit us."); float fontSize = (float)doc.CurrentPage.Body.GetFontSize(); doc.CurrentPage.Body.AddUrl(new RectangleF(10,10, 10 + width, fontSize), "http://www.pdf-technologies.com"); doc.Save(); |
PDF .NET Library for .NET Software Developers - PDF Component Library for C#, VB.NET and ASP.NET developers Copyright © PDF Technologies Inc., 2010. |