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

.align('center') not working after upgrade to v3.0.0 #39

Open
lajith111 opened this issue Oct 17, 2024 · 2 comments
Open

.align('center') not working after upgrade to v3.0.0 #39

lajith111 opened this issue Oct 17, 2024 · 2 comments

Comments

@lajith111
Copy link

.align('center').height(size).line(print.RecieptName ?? '',32).height(1)

Here print.RecieptName not constanct value.. after i search align is deprecated..

How can i achived same using new version..Please let me know

@NielsLeenheer
Copy link
Owner

Align should still work. Not aware of any issues. But the second argument of the line() function is no longer supported. To archive a similar effect you can use the box() function with a style of none.

encoder
    .align('center')
    .box(
        { width: 32, align: 'center', style: 'none'}, 
        'The quick brown fox jumps over the lazy dog. ' + 
        'The quick brown fox jumps over the lazy dog. ' + 
        'The quick brown fox jumps over the lazy dog'
    )

Try pasting this in the playground to see the effect: https://point-of-sale.dev/receipt-printer/playground

Screenshot 2024-10-25 at 21 27 06

@lajith111
Copy link
Author

Ok..Thank You..

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