posSetRelative static method

Uint8List? posSetRelative(
  1. int relative
)

设置相对打印位置 @param relative @return

Implementation

static Uint8List? posSetRelative(int relative) {
  if (relative < 0 || relative > 65535) return null;

  try {
    Command.escAbsolute[2] = relative % 0x100;
    Command.escAbsolute[3] = (relative / 0x100) as int;
  } catch (e) {
    debugPrint(e.toString());
  }
  return Uint8List.fromList(Command.escAbsolute);
}