drawAppearance method

void drawAppearance(
  1. Context context,
  2. PdfAnnotBase bf,
  3. Matrix4 mat,
  4. Widget child, {
  5. PdfAnnotAppearance type = PdfAnnotAppearance.normal,
  6. PdfName? tag,
  7. String? name,
  8. bool selected = false,
})

Implementation

void drawAppearance(
  Context context,
  PdfAnnotBase bf,
  Matrix4 mat,
  Widget child, {
  PdfAnnotAppearance type = PdfAnnotAppearance.normal,
  PdfName? tag,
  String? name,
  bool selected = false,
}) {
  final canvas = bf.appearance(
    context.document,
    type,
    matrix: mat,
    boundingBox: PdfRect(0, 0, box!.width, box!.height),
    name: name,
    selected: selected,
  );

  if (tag != null) {
    canvas.markContentBegin(tag);
  }

  Widget.draw(
    child,
    offset: PdfPoint.zero,
    canvas: canvas,
    page: context.page,
    constraints:
        BoxConstraints.tightFor(width: box!.width, height: box!.height),
  );

  if (tag != null) {
    canvas.markContentEnd();
  }
}