paint method

  1. @override
void paint(
  1. Context context
)
override

Draw itself and its children, according to the calculated box.offset

Implementation

@override
void paint(Context context) {
  super.paint(context);

  if (value != null) {
    context.document.sign ??= PdfSignature(
      context.document,
      value: value!,
      flags: {
        PdfSigFlags.signaturesExist,
        if (appendOnly) PdfSigFlags.appendOnly,
      },
      crl: crl,
      cert: cert,
      ocsp: ocsp,
    );
  } else {
    paintChild(context);
  }

  final bf = PdfAnnotSign(
    rect: context.localToGlobal(box!),
    fieldName: name,
    border: border,
    flags: flags,
    date: date,
    color: color,
    highlighting: highlighting,
  );

  if (child != null && value != null) {
    final mat = getAppearanceMatrix(context);
    drawAppearance(context, bf, mat, child!);
  }

  PdfAnnot(
    context.page,
    bf,
    objser: replaces?.ser,
    objgen: replaces?.gen ?? 0,
  );
}