januslo / react-native-bluetooth-escpos-printer

React-Native plugin for the bluetooth ESC/POS & TSC printers.
MIT License
361 stars 420 forks source link

How to cut paper help me please #55

Open quy1403 opened 5 years ago

quy1403 commented 5 years ago

I have printer XPrinter N160II, its have Auto paper cutting feature, so how can I cut paper progromically? Please help Thanks all!

Tag 2 contributors :) @januslo @#2vgvishal538

rezasazesh commented 4 years ago

Any luck with this?

dorreharay commented 4 years ago

Use this await BluetoothEscposPrinter.cutOnePoint()

takeruadelbert commented 3 years ago

any luck with this? (2)

RedaBEKKA commented 2 years ago

i have this error : BluetoothEscposPrinter.cutOnePoint() is not a function .BluetoothEscposPrinter.cutOnePoint is undefined . Any help !!

RedaBEKKA commented 2 years ago

any luck with this? (2) did you find the answer ?

dorreharay commented 2 years ago

Hi. I see this method in RNBluetoothEscposPrinterModule as it was a year ago. 5C336EFC-2AEC-44B1-B275-4C0FA346802B

I imported lib like this and used await BluetoothEscposPrinter.cutOnePoint(). 0EA04354-BB57-4F79-AF44-54642D160124

May be you need to properly initialise the library. The only way I could print was to reinit on every buffer print. I mean I really needed to find my bluetooth device with react-native-ble-manager every time and init() the library to print my buffer properly. 9A386833-9112-4842-B2AA-0004B832894C

RedaBEKKA commented 2 years ago

Hi. I see this method in RNBluetoothEscposPrinterModule as it was a year ago. 5C336EFC-2AEC-44B1-B275-4C0FA346802B

I imported lib like this and used await BluetoothEscposPrinter.cutOnePoint(). 0EA04354-BB57-4F79-AF44-54642D160124

May be you need to properly initialise the library. The only way I could print was to reinit on every buffer print. I mean I really needed to find my bluetooth device with react-native-ble-manager every time and init() the library to print my buffer properly. 9A386833-9112-4842-B2AA-0004B832894C

Please can you send me your code source , i try but it did not work and i did not work with ble manager

dorreharay commented 2 years ago

Hi. I see this method in RNBluetoothEscposPrinterModule as it was a year ago. 5C336EFC-2AEC-44B1-B275-4C0FA346802B I imported lib like this and used await BluetoothEscposPrinter.cutOnePoint(). 0EA04354-BB57-4F79-AF44-54642D160124 May be you need to properly initialise the library. The only way I could print was to reinit on every buffer print. I mean I really needed to find my bluetooth device with react-native-ble-manager every time and init() the library to print my buffer properly. 9A386833-9112-4842-B2AA-0004B832894C

Please can you send me your code source , i try but it did not work and i did not work with ble manager

https://github.com/dorreharay/adooretail/blob/master/helpers/printer.js

malzate commented 2 years ago

paste this code on your node modules library " rect-native-bluetooth-escpos-printer" android/src/main/java/cn/bluetooth/escpos/RNBluetoothEscPosPrinterModule.java

@ReactMethod public void cut () { byte[] command = PrinterCommand.POS_Set_Cut(1); sendDataByte(command); }

this will create a cut command then you can use like this await BluetoothEscposPrinter.cut();