Commit 2d8cc467 authored by Andrey's avatar Andrey

Updated cut method

parent c4025e03
......@@ -2,6 +2,7 @@ import 'dart:io';
import 'commands.dart';
enum TextAlign { left, center, right }
enum CutMode { normal, partial, full }
/// Abstract printer.
class Printer {
......@@ -87,8 +88,14 @@ class Printer {
_socket.writeAll([cReverseFeedN, n.toString()]);
}
void cut() {
void cut({CutMode mode = CutMode.normal}) {
_socket.write('\n\n\n\n\n');
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