PdfButtonField constructor

PdfButtonField(
  1. PdfPage page,
  2. String name,
  3. Rect bounds, {
  4. String? text,
  5. PdfFont? font,
  6. PdfColor? borderColor,
  7. PdfColor? backColor,
  8. PdfColor? foreColor,
  9. int? borderWidth,
  10. PdfHighlightMode highlightMode = PdfHighlightMode.invert,
  11. PdfBorderStyle borderStyle = PdfBorderStyle.solid,
  12. PdfFieldActions? actions,
  13. String? tooltip,
})

Initializes an instance of the PdfButtonField class with the specific page, name, and bounds.

Implementation

PdfButtonField(
  PdfPage page,
  String name,
  Rect bounds, {
  String? text,
  PdfFont? font,
  PdfColor? borderColor,
  PdfColor? backColor,
  PdfColor? foreColor,
  int? borderWidth,
  PdfHighlightMode highlightMode = PdfHighlightMode.invert,
  PdfBorderStyle borderStyle = PdfBorderStyle.solid,
  PdfFieldActions? actions,
  String? tooltip,
}) {
  _helper = PdfButtonFieldHelper(this);
  _helper.internal(
    page,
    name,
    bounds,
    tooltip: tooltip,
    font: font,
    borderColor: borderColor,
    backColor: backColor,
    foreColor: foreColor,
    borderWidth: borderWidth,
    highlightMode: highlightMode,
    borderStyle: borderStyle,
  );
  _helper.dictionary!.setProperty(
    PdfDictionaryProperties.ft,
    PdfName(PdfDictionaryProperties.btn),
  );
  if (backColor == null) {
    _helper.backColor = PdfColor(211, 211, 211);
  }
  _helper.flags.add(FieldFlags.pushButton);
  _helper.initValues(text, actions);
}