I need you help to open cash drawer with your script

1,903 views
Skip to first unread message

Nileksh Dhimer

unread,
Jan 16, 2017, 12:30:52 AM1/16/17
to qz-p...@googlegroups.com
Hello there,


   I am using your script to print recipt and open cash drawer but issue is pass PDF as source and then try to open cash drawer.

   I am already study your example code but i am not getting idea how to open cash drawer.
below is my code: 
  function print() {      
        
        var options =  { size: { width: 8.5, height: 11}, units: "in", density: "600" };
        var config = qz.configs.create(printer, options);
        var data = [{ type: 'pdf', data: '/Ticket/Receipt.pdf' }];       
        qz.append('\x10' + '\x14' + '\x01' + '\x00' + '\x05');//Open cash drawer
        console.log('Done');
        return qz.print(config, data);
}
my above code not working when i try to put red color text into my function.

   I am waiting of your reply.

Lite Finocchiaro

unread,
Jan 16, 2017, 4:46:44 PM1/16/17
to Nileksh Dhimer, qz-print

Nileksh:

Can you tell us more about your environment? It looks as though you have specified a "Letter" size document (8.5x11 inches). Normally, the printers that can open cash drawers with this command are receipt printers, usually 80mm (3.125 inches) or less, with a continuous roll of paper. They are attached to the cash drawer with a cable that sends a voltage pulse to the drawer, allowing it to open.

What printer are you sending this to?

What cash register?

Additionally, the command to open the cash drawer that you have is for raw printing in ESCP only. We use this code with printers that are compatible with ESCP (ESC/POS, ESCP2, et cetera), and the printer must be set up as a raw (generic/text-only) queue to process these commands. Some such printers are Epson, Citizen, and Star, but there are many others.

Alternately, you may modify the driver for your printer to send a voltage pulse after the job is complete. This is done via the PC to which the printer is connected.

Mixing Pixel-based printing with Raw printing is possible, but you must use separate print functions for it to work properly.

Once we know what equipment you are working with, we can better advise you on the function you need to execute. We look forward to your reply.


Note: if your cash drawer is USB, then the implementation will be different, as a separate device must be found. I will elaborate if this is the case.

Kind regards,

Lite Finocchiaro
VP, QZ Industries, LLC



--
You received this message because you are subscribed to the Google Groups "qz-print" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Lite Finocchiaro

unread,
Jan 16, 2017, 7:34:47 PM1/16/17
to Nileksh Dhimer, qz-print
Also, I should mention that it looks like you're using QZ-Tray 1.9 syntax in your code.

I strongly encourage you to use 2.0 moving forward. We will no longer be developing the 1.9 branch of QZ-Tray, and the syntax for 2.0 is much more efficient:

https://qz.io/wiki/2.0-raw-printing#escp


https://qz.io/wiki/2.0-pixel-printing#pdf-printing

Reply all
Reply to author
Forward
0 new messages