setFillPattern method

void setFillPattern(
  1. PdfPattern pattern
)

Sets the fill pattern for drawing

Implementation

void setFillPattern(PdfPattern pattern) {
  var o = 0;
  assert(() {
    if (_page.pdfDocument.settings.verbose) {
      o = _buf.offset;
      _buf.putString(' ' * (_indent));
    }
    return true;
  }());

  // The shader needs to be registered in the page resources
  _page.addPattern(pattern);
  _buf.putString('/Pattern cs${pattern.name} scn ');

  assert(() {
    if (_page.pdfDocument.settings.verbose) {
      _buf.putString(' ' * math.max(0, _commentIndent - _buf.offset + o));
      _buf.putComment('setFillPattern(${pattern.ref()})');
    }
    return true;
  }());
}