问题
I need to add printing functionality on a zebra ZQ520 bluetooth thermal printer in an application developed in flutter (Android), does anyone have any suggestions or packages to perform this task? I tried with the packages: esc_pos_printer, esc_pos_bluetooth, flutter-zsdk, zsdk
, but I was not successful.
Thank you!
回答1:
You can have mine plugin from https://github.com/gmeles/flutter_cblue
You place it in the project root folder and add your dependency on pub spec.yaml like
dependencies:
flutter:
sdk: flutter
................
flutter_cblue:
path: ../flutter_cblue
The printer must be already paired and it's name must starts with 'zebra'
After that you only send strings
import 'package:flutter_cblue/flutter_cblue.dart';
FlutterCblue.printToBT(printStr: '^XA^CFA,30 ^FO50,300^FDHello World^FS ^XZ')
.then((result) {
.............
It works only on android, have no need for iOS for this project
Check the code ......
Check that your ZPL commands are correct using http://labelary.com/viewer.html
来源:https://stackoverflow.com/questions/62994695/package-flutter-bluetooth-to-zebra