getBarCodeWidth method

int getBarCodeWidth(
  1. String context,
  2. int lineWidth
)

计算条码宽度

context 内容

lineWidth 窄条的单位宽度,默认1

Implementation

int getBarCodeWidth(String context, int lineWidth) {
  var barcode = new Code128(context);
  return barcode.getEncoding().length * (lineWidth + 1);
}