andrey-ushakov / esc_pos_utils

Basic Flutter/Dart classes for ESC/POS printing
BSD 3-Clause "New" or "Revised" License
151 stars 339 forks source link

Don't print styles in zebra #73

Open anthonyR012 opened 2 years ago

anthonyR012 commented 2 years ago

I try to use styles in print aplication, for example: generator.text("test", styles : PosStyles(aling:PosAlign.center )), but when printed my facture, it is not show it styles, only print letters, so, I searched posible solution but don't found anything that solve my problem, I sorry for my English, I am colombian.

use it as the library but, it doesn't work for me,

`Future _startPrint(PrinterBluetooth printer) async { _printerManager.selectPrinter(printer);

final result = await _printerManager.printTicket(await testTicket());

showDialog(
  context: context,
  builder: (_) => AlertDialog(
    content: Text(result.msg),
  ),
);

}

Future<List> testTicket() async { List bytes = []; // Using default profile final profile = await CapabilityProfile.load(); final generator = Generator(PaperSize.mm80, await CapabilityProfile.load());

bytes += generator.text('Text size 200%', styles: PosStyles( height: PosTextSize.size2, width: PosTextSize.size2, )); bytes += generator.row([ PosColumn( text: 'col3', width: 3, styles: PosStyles(align: PosAlign.center, underline: true), ), PosColumn( text: 'col6', width: 6, styles: PosStyles(align: PosAlign.center, underline: true), ), PosColumn( text: 'col3', width: 3, styles: PosStyles(align: PosAlign.center, underline: true), ), ]); bytes += generator.text(" Hola mi nombre es juan ernesto perez \r\n", styles: PosStyles( align: PosAlign.center ));

bytes += generator.text(" Hola mi nombre es juan ernesto perez \r\n", styles: PosStyles(

)); bytes += generator.text(" Hola mi nombre es juan ernesto perez \r\n"); bytes += generator.text(" Hola mi nombre es juan ernesto perez \r\n");

bytes += generator.feed(2); bytes += generator.cut(); return bytes; }`