Draw Text
Draws text on a PDF page with formatting options.
Code
using DRIT.Pdf;
using var doc = new PdfDocument();
var page = doc.Pages.Add(PdfPageSize.A4);
var content = page.Content;
// Draw simple text
content.DrawText("Hello, PDF!", new PdfPoint(100, 700));
// Draw formatted text
var formattedText = new PdfFormattedText();
formattedText.Append("Formatted ", 24, PdfFontFamily.Helvetica, PdfFontWeight.Bold, PdfColor.Red);
formattedText.Append("text", 24, PdfFontFamily.Helvetica, PdfFontWeight.Normal, PdfColor.Blue);
content.DrawText(formattedText, new PdfPoint(100, 650));
doc.Save("text.pdf");