drawOverlay method

void drawOverlay(
  1. void build(
    1. PdfGraphics canvas
    )
)

Draws over the original content.

The callback receives a PdfGraphics in the user space of the page, already inside a q ... Q of its own. To position from the top of the page, use transformer.

Implementation

void drawOverlay(void Function(PdfGraphics canvas) build) {
  _ensureWrap();
  final canvas = _suffixGraphics!;
  canvas.saveContext();
  build(canvas);
  canvas.restoreContext();
  page.altered = true;
}