output method

  1. @override
void output(
  1. PdfObjectBase<PdfDataType> o,
  2. PdfStream s, [
  3. int? indent
])
override

Implementation

@override
void output(PdfObjectBase o, PdfStream s, [int? indent]) {
  if (indent != null) {
    s.putBytes(List<int>.filled(indent, 0x20));
    indent += kIndentSize;
  }
  s.putString('[');
  if (values.isNotEmpty) {
    for (var n = 0; n < values.length; n++) {
      final val = values[n];
      if (indent != null) {
        s.putByte(0x0a);
        if (val is! PdfDict && val is! PdfArray) {
          s.putBytes(List<int>.filled(indent, 0x20));
        }
      } else {
        if (n > 0 &&
            !(val is PdfName ||
                val is PdfString ||
                val is PdfArray ||
                val is PdfDict)) {
          s.putByte(0x20);
        }
      }
      val.output(o, s, indent);
    }
    if (indent != null) {
      s.putByte(0x0a);
    }
  }
  if (indent != null) {
    indent -= kIndentSize;
    s.putBytes(List<int>.filled(indent, 0x20));
  }
  s.putString(']');
}