drawTextBox method

void drawTextBox(
  1. PdfDocument document,
  2. String text,
  3. PdfVisualFont font,
  4. PdfRect bounds, {
  5. PdfColor? color,
})

Implementation

void drawTextBox(
  PdfDocument document,
  String text,
  PdfVisualFont font,
  PdfRect bounds, {
  PdfColor? color,
}) {
  final resolved = font.resolve(document);
  final y = bounds.bottom + bounds.height - font.ascent(document);

  saveContext();
  if (color != null) {
    setFillColor(color);
  }
  drawString(resolved, font.size, text, bounds.left, y);
  restoreContext();
}