• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support

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");

Output

text.pdf

  • Improve this Doc
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX