react-native-thermal-receipt-printer-image-qr icon indicating copy to clipboard operation
react-native-thermal-receipt-printer-image-qr copied to clipboard

How we open a drawer after printing Receipt

Open komailabbas12 opened this issue 2 years ago • 6 comments

komailabbas12 avatar Sep 23 '22 09:09 komailabbas12

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 avatar Oct 20 '22 01:10 lcang121

@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 avatar Mar 01 '23 08:03 komailabbas12

@lcang121

komailabbas12 avatar Mar 01 '23 09:03 komailabbas12

@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 avatar Jan 24 '24 08:01 MaheshKaemSolutions

@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

komailabbas12 avatar Jan 24 '24 10:01 komailabbas12