Commit 2d8cc467 authored by Andrey's avatar Andrey

Updated cut method

parent c4025e03
...@@ -2,6 +2,7 @@ import 'dart:io'; ...@@ -2,6 +2,7 @@ import 'dart:io';
import 'commands.dart'; import 'commands.dart';
enum TextAlign { left, center, right } enum TextAlign { left, center, right }
enum CutMode { normal, partial, full }
/// Abstract printer. /// Abstract printer.
class Printer { class Printer {
...@@ -87,8 +88,14 @@ class Printer { ...@@ -87,8 +88,14 @@ class Printer {
_socket.writeAll([cReverseFeedN, n.toString()]); _socket.writeAll([cReverseFeedN, n.toString()]);
} }
void cut() { void cut({CutMode mode = CutMode.normal}) {
_socket.write('\n\n\n\n\n'); _socket.write('\n\n\n\n\n');
_socket.write(cCut); if (mode == CutMode.partial) {
_socket.write(cCutPart);
} else if (mode == CutMode.full) {
_socket.write(cCutFull);
} else {
_socket.write(cCut);
}
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment