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

How we open a drawer after printing Receipt #81

Open
komailabbas12 opened this issue Sep 23, 2022 · 5 comments
Open

How we open a drawer after printing Receipt #81

komailabbas12 opened this issue Sep 23, 2022 · 5 comments

Comments

@komailabbas12
Copy link

No description provided.

@lcang121
Copy link

the library doesn't have a method to open cash drawer. I'm using this to open the drawer instead:

const openDrawerBuffer = new Buffer(
['\u001B', '\u0070', '\u0000', '\u0025', '\u0250'].join('')
);
USBPrinter.printRaw(openDrawerBuffer.toString('base64'));

@komailabbas12
Copy link
Author

komailabbas12 commented Mar 1, 2023

@lcang121 Hi thank you for your help.
please guide me.

  1. which package you use for buffer
  2. where i find this value ['\u001B', '\u0070', '\u0000', '\u0025', '\u0250']. for my cash drawer or this is static for all cash drawer

@komailabbas12
Copy link
Author

@lcang121

@MaheshKaemSolutions
Copy link

@komailabbas12 have you tried the COMMAD given by this library? like
import {
COMMANDS,
} from 'react-native-thermal-receipt-printer-image-qr';

COMMANDS.CASH_DRAWER.CD_KICK_2;
OR
COMMANDS.CASH_DRAWER.CD_KICK_5;
Let me know if this solutions works for you.
FYI @lcang121

@komailabbas12
Copy link
Author

komailabbas12 commented Jan 24, 2024

@MaheshKaemSolutions yaah and its working
const openDrawerBuffer = new Buffer( ['\u001B', '\u0070', '\u0000', '\u0025', '\u0250'].join('') ); USBPrinter.printRaw(openDrawerBuffer.toString('base64'));
and import is below

import { Buffer } from 'buffer' import { ColumnAliment, COMMANDS, USBPrinter } from 'react-native-thermal-receipt-printer-image-qr';

Thank you @MaheshKaemSolutions @lcang121

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

3 participants