thiendangit / react-native-thermal-receipt-printer-image-qr

React native thermal receipt printer
https://www.npmjs.com/package/react-native-thermal-receipt-printer-image-qr
119 stars 80 forks source link

How we open a drawer after printing Receipt #81

Open komailabbas12 opened 2 years ago

lcang121 commented 2 years ago

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 commented 1 year ago

@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 commented 1 year ago

@lcang121

MaheshKaemSolutions commented 9 months ago

@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 commented 9 months ago

@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

MaheshKaemSolutions commented 3 months ago

is it working on IOS @komailabbas12 @lcang121 ?