setGraphicState method

void setGraphicState(
  1. PdfGraphicState state
)

Set the graphic state for drawing

Implementation

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

  final name = _page.stateName(state);
  _buf.putString('$name gs ');

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