-
Notifications
You must be signed in to change notification settings - Fork 343
Open
Description
I tried your example running in windows:
Future imprime() async {
final PaperSize paper = PaperSize.mm80;
final profile = await CapabilityProfile.load();
final printer = NetworkPrinter(paper, profile);
final PosPrintResult res = await printer.connect('10.0.0.168', port: 9100);
if (res == PosPrintResult.success) {
testReceipt(printer);
printer.disconnect();
}
print('Print result: ${res.msg}');
return res.msg;
}
I get a "success" message but nothing is printed.
I then used this code, and it worked:
void printTicketViaLan(List bytes) async {
Duration timeout = const Duration(seconds: 5);
var result = await Socket.connect('10.0.0.168', 9100, timeout: timeout)
.then((Socket socket) {
socket.add(bytes);
socket.destroy();
return 'Data sent Success';
}).catchError((dynamic e) {
return 'Error sending Data';
});
debugPrint(result);
}
I really don't understand what is happening.
Could you advice.
Metadata
Metadata
Assignees
Labels
No labels