'''' This code is part of Document Solutions for PDF .NET demos.'' Copyright (c) MESCIUS inc. All rights reserved.''ImportsSystemImportsSystem.IOImportsSystem.DrawingImportsGrapeCity.Documents.PdfImportsGrapeCity.Documents.Text '' This sample demonstrates the difference between WordWrap And CharWrap'' text wrapping modes.PublicClassWordCharWrapFunctionCreatePDF(ByVal stream AsStream) AsIntegerDim str ="Lose nothing in your documents! Document Solutions for PDF includes text and paragraph formatting, " +"special characters, multiple languages, RTL support, vertical and rotated text on all supported platforms." Dim doc = NewGcPdfDocument()Dim page = doc.NewPage()Dim g = page.Graphics Dim tl = g.CreateTextLayout() tl.Append(str) tl.DefaultFormat.Font = StandardFonts.Times tl.DefaultFormat.FontSize = 12 tl.MaxWidth = 72 * 3 tl.WrapMode = WrapMode.WordWrap tl.PerformLayout(True) Dim dy = tl.Lines(0).Height + 72 \ 16Dim rc = NewRectangleF(72, 72 + dy, tl.MaxWidth, 72 * 1.4F) g.DrawString("WrapMode.WordWrap:", tl.DefaultFormat, NewPointF(rc.Left, rc.Top - dy)) g.DrawTextLayout(tl, rc.Location) g.DrawRectangle(rc, Color.CornflowerBlue) rc.Offset(0, 72 * 2) tl.WrapMode = WrapMode.CharWrap tl.PerformLayout(False) g.DrawString("WrapMode.CharWrap:", tl.DefaultFormat, NewPointF(rc.Left, rc.Top - dy)) g.DrawTextLayout(tl, rc.Location) g.DrawRectangle(rc, Color.CornflowerBlue) '' Done doc.Save(stream)Return doc.Pages.CountEndFunctionEndClass