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

Text is not aligned center when print the bill #537

Open
surjannegi opened this issue Sep 12, 2024 · 6 comments
Open

Text is not aligned center when print the bill #537

surjannegi opened this issue Sep 12, 2024 · 6 comments

Comments

@surjannegi
Copy link

Hi All, I want to thanks @DantSu for the library . I am using the library to print the bill using Android app.

I am generating the print string using StringBuilder class in java. When I center align text using "[C]" , but it does not completely center align .

Please find the attachment.
Untitled

Any help is appreciated

@harsh8088
Copy link

@surjannegi
Try to change your printerWidthMM in EscPosPrinter

val printer = EscPosPrinter(UsbConnection(usbManager, usbDevice), 203, 80f, 32)

and I somehow managed to center the dynamic content.

Like this:

Media (1)

@surjannegi
Copy link
Author

Thanks @harsh8088 for your response, will this align the complete text center align ? Because I want to center align the specific text , not the complete text.
I can see your screen shot , everything is center aligned ..

@harsh8088
Copy link

harsh8088 commented Sep 16, 2024

Thanks @harsh8088 for your response, will this align the complete text center align ? Because I want to center align the specific text , not the complete text. I can see your screen shot , everything is center aligned ..

Yes, I have added multiline center text too. Please have a look at my code here https://github.com/DantSu/ESCPOS-ThermalPrinter-Android/issues/538

@surjannegi
Copy link
Author

I clicked on the above link , i can't see any code there ..

@harsh8088
Copy link

I clicked on the above link , i can't see any code there ..

Check the latest Open Issue(Font Issue):
#538

@surjannegi
Copy link
Author

Thanks @harsh8088 , will check that

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