Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PosAlign is not working.... #100

Open
zakir7dipu opened this issue Feb 17, 2021 · 2 comments
Open

PosAlign is not working.... #100

zakir7dipu opened this issue Feb 17, 2021 · 2 comments

Comments

@zakir7dipu
Copy link

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........

@emmaxCreative
Copy link

emmaxCreative commented Jun 10, 2021

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
Copy link

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 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants