andrey-ushakov / esc_pos_printer

ESC/POS (thermal, receipt) printing for Flutter & Dart
BSD 3-Clause "New" or "Revised" License
346 stars 298 forks source link

Can we print Marathi language text using esc_pos_printer #189

Open MohsinP07 opened 10 months ago

MohsinP07 commented 10 months ago

Hii, In my project i want to print the text in Marathi Language is it possible. Here is my code
Future printMarathiText() async { final profile = await CapabilityProfile.load(); final printer = NetworkPrinter(PaperSize.mm80, profile); List bytes = []; final generator = Generator(PaperSize.mm80, profile); await connectToPrinter();

bytes += generator.text('मराठी मध्ये टेक्स्ट प्रिंट करणारा प्रिंटर',
    styles: const PosStyles(
      align: PosAlign.center,
      height: PosTextSize.size1,
      width: PosTextSize.size1,
    ),
    linesAfter: 1);

// printer.text('मराठी मध्ये टेक्स्ट प्रिंट करणारा प्रिंटर');

printer.cut();
printer.disconnect();

} i am getting error as ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Invalid argument (string): Contains invalid characters.: "मराठी मध्ये टेक् स्ट प्रिंट करणारा प्रिंटर" . Is there an solution for this?

abdullatheeftk-gulf commented 8 months ago

first convert text to image either by flutter or native code by mrthod channel