-
Notifications
You must be signed in to change notification settings - Fork 18
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
Getting ESCPOS commands instead of Uint8Array of bytes #27
Comments
I am searching for this feature too. |
@umutesen I found a solution which might help you |
I found a small function to handle decoding Uint8Array:
Source here |
You could also do it a bit easier: const escpos = new EscPosEncoder();
const printValue = escpos.initialize()
.line('This is a test line')
.encode();
// this is a string representation
const result = Buffer.from(printValue.buffer).toString();
If you are using this from browser, then I recomend also using tihs lib: https://github.com/feross/buffer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
encode
appears to generate anUint8Array
array containing all the bytes. How can I generateESC/POS
commands instead of the byte array?The text was updated successfully, but these errors were encountered: