I use following code to do two task, 1) print receipt and then 2) open cash drawer, BUT it only print receipt,it does NOT open cash drawer :( qz.append("\x1B\x40"); // reset printer qz.append("Receipt Text Samples 1\r\n"); // text on receipt qz.append("Receipt Text Samples 2\r\n"); // text on receipt qz.append("\r\n"); qz.append("\x1B\x40"); //reset printer qz.append("\x1D\x56\x41"); // cut paper qz.append(chr(27) + "\x70" + "\x30" + chr(25) + chr(25)); //open cash drawer code qz.print();
When I only run code for opening cash drawer like following code, it will work and open cash drawer. Means hardware support opening cash drawer.
qz.append(chr(27) + "\x70" + "\x30" + chr(25) + chr(25)); //open cash drawer code qz.print();
Summary
Only Print Receipt it works
qz.append("Receipt Text Samples 1\r\n"); // text on receipt
qz.print();
Output: print receipt successfully
Only Open Cash Drawer it works
qz.append(chr(27) + "\x70" + "\x30" + chr(25) + chr(25)); //open cash drawer code qz.print();
Output: Open Cash Drawer successfully
For print receipt and then open cash drawer
qz.append("Receipt Text Samples 1\r\n"); // text on receipt
qz.append(chr(27) + "\x70" + "\x30" + chr(25) + chr(25)); //open cash drawer code
qz.print();
Output: print receipt successfully but cash drawer does NOT open !
Question : What to do for print receipt and then open cash drawer ? please write sample code if possible.
Helo Paresh,
Can you try this :
qz.append("\x1B\x40\r"); // reset printer
qz.append("Receipt Text Samples 1\r\n"); // text on receipt
qz.append("Receipt Text Samples 2\r\n"); // text on receipt
qz.append("\r\n");
qz.append("\x1D\x56\x41\r"); // cut paper
qz.append(chr(27) + "\x70" + "\x30" + chr(25) + chr(25) + "\r"); //open cash drawer code
qz.print();
You can change open cash drawer code like “\x1B\x70\x30\x19\x19\r” too.
I hope this can help you.
Rgds,
Siau Pheng
--
--
To unsubscribe from this group, send email to jzebra-users...@googlegroups.com
http://code.google.com/p/jzebra
---
You received this message because you are subscribed to the Google Groups "jZebra users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jzebra-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Paresh,
I dont know why in your code is not running, but in my code is running well.
All code print, opencashdrawer and cutting paper is working in one print() call.
My code like this :
qz.append("\x1B\x40\r"); // ESC @
qz.append("\x1B\x70\x30\x19\x19\r"); // if open drawer on begin
qz.append("\x1B\x21\x10\r\x1b\x61\x01\rSTORE NAME\r\n\x1B\x21\x01\rCITY\r\n\x1b\x61\x00\r");
qz.append("\n");
qz.append("Content ... bla bla bla\n");
qz.append("Content ... bla bla bla\n");
qz.append("Content ... bla bla bla\n");
qz.append("\n");
qz.append("\x1D\x56\x41\r"); // cut paper
//qz.append("\x1B\x70\x30\x19\x19\r"); // if open drawer on end
qz.print();
You can see, maybe you can try move up open cash drawer code to execute first before content. In my code, user can select choice want to open cash drawer at begin or end.