Open Rabeeh96 opened 2 years ago
i have tried below codes .. but still not get anyting.. printing wrong characters.. any one have solutions ?
List
byte += ticket.textEncoded(encSeller,
styles: const PosStyles(
height: PosTextSize.size1,
width: PosTextSize.size1,
align: PosAlign.center,
codeTable: 'CP864'));
printer.rawBytes(byte);
I suggest to you writing everything to in HTML then converting the content to image bytes using webcontent_converter package then print the bytes. I have done this, and it works perfectly with Arabic.
E/flutter (16225): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Invalid argument (string): Contains invalid characters.: "السلام عليكم ورحمة الله وبركاته" E/flutter (16225): #0 _UnicodeSubsetEncoder.convert (dart:convert/ascii.dart:85:9) E/flutter (16225): #1 Latin1Codec.encode (dart:convert/latin1.dart:40:46) E/flutter (16225): #2 Generator._encode (package:esc_pos_utils_plus/src/generator.dart:78:21) E/flutter (16225): #3 Generator.text (package:esc_pos_utils_plus/src/generator.dart:355:9) E/flutter (16225): #4 ESCPrinterService.getBytes (package:bluetooth_test/MasterBluetooth/service.dart:68:24) E/flutter (16225):
E/flutter (16225): #5 _InvoicePrintScreenState._startPrinter (package:bluetooth_test/MasterBluetooth/bluetoothPrint.dart:248:16)
E/flutter (16225):
E/flutter (16225):