react-native-thermal-receipt-printer-image-qr
react-native-thermal-receipt-printer-image-qr copied to clipboard
How we open a drawer after printing Receipt
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'));
@lcang121 Hi thank you for your help. please guide me.
- which package you use for buffer
- where i find this value ['\u001B', '\u0070', '\u0000', '\u0025', '\u0250']. for my cash drawer or this is static for all cash drawer
@lcang121
@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
@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