'''' This code is part of Document Solutions for PDF .NET demos.'' Copyright (c) MESCIUS inc. All rights reserved.''ImportsSystem.IOImportsSystem.DrawingImportsGrapeCity.Documents.PdfImportsGrapeCity.Documents.Text '' This sample demonstrates how to use TextLayout.TabStops to render columns'' of floating point numbers aligned in different ways:'' - aligned on the decimal point via TabStopAlignment.Separator'' - left-aligned on the tab position using TabStopAlignment.Leading'' - centered around the tab position using TabStopAlignment.Center'' - right-aligned on the tab position using TabStopAlignment.Trailing.PublicClassTabsAlignmentFunctionCreatePDF(ByVal stream AsStream) AsInteger'' Create and set up the document:Dim doc = NewGcPdfDocument()Dim page = doc.NewPage()Dim g = page.Graphics'' Create and set up a TextLayout object to print the text:Dim tl = g.CreateTextLayout() tl.MaxWidth = page.Size.Width tl.MaxHeight = page.Size.Height tl.MarginLeft = 36 tl.MarginRight = 36 tl.MarginTop = 36 tl.MarginBottom = 36 tl.DefaultFormat.Font = StandardFonts.Times tl.DefaultFormat.FontSize = 10 tl.DefaultFormat.BackColor = Color.FromArgb(217, 217, 217)'' Add tab stops with different alignment types'' (the 1st ctor creates a TabStopAlignment.Separator TabStop): tl.TabStops = New List(OfTabStop)() From {NewTabStop(72, "."c),NewTabStop(72 * 2.5F, TabStopAlignment.Leading),NewTabStop(72 * 5, TabStopAlignment.Center),NewTabStop(72 * 7.5F, TabStopAlignment.Trailing) }'' Render sample text: tl.Append($"TabStopAlignment:{vbCrLf}{vbTab}Separator '.'{vbTab}Leading{vbTab}Center{vbTab}Trailing{vbCrLf}")Dim v0 AsDouble = 1Dim q AsDouble = (1 + Math.Sqrt(5)) / 2For i = 1To50 tl.Append($"{vbTab}{v0:R}{vbTab}{v0:R}{vbTab}{v0:R}{vbTab}{v0:R}{vbCrLf}") v0 *= qNext tl.PerformLayout(True)'' Draw the text and images: g.DrawTextLayout(tl, PointF.Empty)'''' Done: doc.Save(stream)Return doc.Pages.CountEndFunctionEndClass