//// This code is part of Document Solutions for PDF .NET demos.// Copyright (c) MESCIUS inc. All rights reserved.//usingSystem.IO;usingSystem.Drawing;usingGrapeCity.Documents.Pdf;usingGrapeCity.Documents.Text;usingGrapeCity.Documents.Drawing;usingGCTEXT = GrapeCity.Documents.Text;usingGCDRAW = GrapeCity.Documents.Drawing; namespaceDsPdfWeb.Demos.Basics{// Shows how to easily render a simple bullet list using a single TextLayout.publicclassEasyBulletList {publicintCreatePDF(Stream stream) {constintFontSize = 12;var doc = newGcPdfDocument();var page = doc.Pages.Add();var g = page.Graphics;var tl = g.CreateTextLayout(); var img = GCDRAW.Image.FromFile(Path.Combine("Resources", "ImagesBis", "2020-website-gcdocs-headers_tall.png"));var rc = page.Bounds; rc.Height *= 0.65f; g.DrawImage(img, rc, null, ImageAlign.StretchImage); var ip = newPointF(48, 72); var font = GCTEXT.Font.FromFile(Path.Combine("Resources", "Fonts", "NotoSans-Regular.ttf"));var tfCap = newTextFormat() { Font = font, FontSize = FontSize * 1.6f, ForeColor = Color.White };var tf = newTextFormat() { Font = font, FontSize = FontSize, ForeColor = Color.White }; tl.MaxWidth = 72 * 6; // Header: tl.AppendLine("Feature-Rich C# .NET PDF API Library for Total Document Control", tfCap); tl.AppendLine(tfCap); tl.AppendLine("Document Solutions for PDF (DsPdf, previously GcPdf) allows you to generate documents with speed, memory efficiency with no dependencies.", tf); tl.AppendLine(tf); g.DrawTextLayout(tl, ip); // Bullet list: ip.Y += tl.ContentHeight; tl.Clear();conststringbullet = "\x2022\x2003"; tl.FirstLineIndent = -g.MeasureString(bullet, tf).Width; tl.ParagraphSpacing += 4; tl.Append(bullet, tf); tl.AppendLine("Generate, load, edit, and save PDF documents in C# or VB", tf); tl.Append(bullet, tf); tl.AppendLine("Support multiple languages with full text, paragraph formatting, and fonts", tf); tl.Append(bullet, tf); tl.AppendLine("Mark and redact sensitive content from PDFs", tf); tl.Append(bullet, tf); tl.AppendLine("View or embed audio and video content in PDFs", tf); tl.Append(bullet, tf); tl.AppendLine("Multiple options for optimizing PDF documents", tf); tl.Append(bullet, tf); tl.AppendLine("Support hundreds of PDF features", tf); tl.Append(bullet, tf); tl.AppendLine("All features are fully supported on Windows, macOS, and Linux", tf); tl.Append(bullet, tf); tl.AppendLine("Includes a JavaScript PDF Viewer to view and edit PDF documents", tf); g.DrawTextLayout(tl, ip); doc.Save(stream);return doc.Pages.Count; } }}