如何使用 flutter 中的“esc_pos_utils”包在 Zebra ZQ220 中打印阿拉伯文本

问题描述 投票:0回答:1

我用的是打印机:Zebra ZQ220

我目前正在使用:

  • esc_pos_utils:^1.1.0
  • flutter_pos_printer_platform:^1.0.12

打印机打印英文成功。但是当我们尝试打印阿拉伯语时,它打印出奇怪的字符而不是阿拉伯语文本。

我尝试了两种发送编码字符串的方法:

第一:

final arabicText = utf8.encode('شركه هنا');
Uint8List uint8List = Uint8List.fromList(arabicText);
bytes += generator.textEncoded(uint8List);

第一路输出(utf8_Arabic):

================================================= =====

第二个:

final List<int> codeUnits = 'شركه هنا'.codeUnits;    
final Uint8List unit8List = Uint8List.fromList(codeUnits);
bytes += generator.textEncoded(unit8List);

第二种方式输出(codeUnits_Arabic):

此外,我将代码页设置为“CP1252”,但此代码页在英语而非阿拉伯语中运行良好。

flutter printing zebra-printers thermal-printer escpos
1个回答
0
投票

我最终找到了一些有用的用于热敏打印机的 Flutter SDK,它们支持多种语言,包括阿拉伯语:

  • bluetooth_thermal_printer - 这是一个 Flutter 插件,允许您在 Android 设备上使用蓝牙热敏打印机。
  • blue_print_pos - 这是一个 Flutter 插件,可让您使用 Android 和 iOS 设备上的 POS(销售点)系统。
    这是我在 2022 年 12 月使用的更新后的分叉 blue_print_pos SDK。您可以毫无问题地使用它。
© www.soinside.com 2019 - 2024. All rights reserved.