esc_pos_printer icon indicating copy to clipboard operation
esc_pos_printer copied to clipboard

PosAlign is not working....

Open zakir7dipu opened this issue 4 years ago • 2 comments

when I am using this "printer.text('Align center', styles: PosStyles(align: PosAlign.center));", the text align remain left and it takes a lots of new lines..... what should I do? My printer is Star mC-Print3 series........

zakir7dipu avatar Feb 17 '21 15:02 zakir7dipu

Did you find a solution ?

I have the same problem .

When I add an image then everything is centered but without logo it uses only left align

emmaxCreative avatar Jun 10 '21 21:06 emmaxCreative

I found out you can use to center align by sending raw data

printer.rawBytes([
      0x1B,
      0x61,
      0x31,
    ]);

and then if you want to go back to left align you can send

printer.rawBytes([
      0x1B,
      0x61,
      0x30,
    ]);

Maybe these commands in esc_pos_utils package are wrong? I tried forking it but somehow I was not able to use my changes.

 //Print Position
 const cAlignLeft = '${esc}a0'; // Left justification
 const cAlignCenter = '${esc}a1'; // Centered
 const cAlignRight = '${esc}a2'; // Right justification
 //Print Position
 const cAlignLeft = '$esc\x30'; // Left justification
 const cAlignCenter = '$esc\x31'; // Centered
 const cAlignRight = '$esc\x32'; // Right justification

correct me if Im wrong. Would be great to hear the author of the package (@andrey-ushakov )

emmaxCreative avatar Jun 11 '21 08:06 emmaxCreative