QZ Print Function on User Endpoint

49 views
Skip to first unread message

Daniel Grgić

unread,
Nov 22, 2020, 1:13:05 PM11/22/20
to qz-p...@googlegroups.com
Hello QZ Print Supportter.

I am a web designer and developer from UK and have been developing Food Delivery & Ordering web application for the last 6 months with Node + React.
Now, I want to add function what store owner can print order information on his endpoint when click Print Button with QZ print.
Please let me know how I can implement that function.

Looking forward to hearing back from you soon.
Regards.

Lite Finocchiaro

unread,
Nov 22, 2020, 3:11:21 PM11/22/20
to Daniel Grgić, qz-print
Daniel:

Thanks for your interest in QZ-Tray!

Here is a simple example for implementing QZ-Tray's print functionality:


We encourage implementation with 2.1 at this time.

Regards,

Lite Finocchiaro
VP, QZ Industries

--
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+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qz-print/CAESjinMDXyi%2BQ8RWN3CVY6R3FBtdyyXRnom_hRMkxNuTk4MoqA%40mail.gmail.com.

grgicd...@gmail.com

unread,
Nov 25, 2020, 2:44:47 AM11/25/20
to qz-print
Thanks for your reply.
I tested print with ESCPOS raw print method to my StarPrinter with follow codes.
But that returns error , and I failed too many times to raw print function for my webstie order for several cases.
Please help me to implement my text order.

var data = [
    {
      type: 'raw',
      options: { language: 'ESCPOS'dotDensity: 'double',  },
    },
    '\x1B' + '\x40'// init
    '\x1B' + '\x61' + '\x31'// center align
    'Beverly Hills, CA  90210' + '\x0A',
    '\x0A'// line break
    'www.qz.io' + '\x0A'// text and line break
    '\x0A'// line break
    '\x0A'// line break
    'May 18, 2016 10:30 AM' + '\x0A',
    '\x0A'// line break
    '\x0A'// line break
    '\x0A',
    'Transaction # 123456 Register: 3' + '\x0A',
    '\x0A',
    '\x0A',
    '\x0A',
    '\x1B' + '\x61' + '\x30'// left align
    'Baklava (Qty 4)       9.00' + '\x1B' + '\x74' + '\x13' + '\xAA'//print special char symbol after numeric
    '\x0A',
    'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' + '\x0A',
    '\x1B' + '\x45' + '\x0D'// bold on
    "Here's some bold text!",
    '\x0A',
    '\x1B' + '\x45' + '\x0A'// bold off
    '\x1D' + '\x21' + '\x11'// double font size
    "Here's large text!",
    '\x0A',
    '\x1D' + '\x21' + '\x00'// standard font size
    '\x1B' + '\x61' + '\x32'// right align
    '\x1B' + '\x21' + '\x30'// em mode on
    'DRINK ME',
    '\x1B' + '\x21' + '\x0A' + '\x1B' + '\x45' + '\x0A'// em mode off
    '\x0A' + '\x0A',
    '\x1B' + '\x61' + '\x30'// left align
    '------------------------------------------' + '\x0A',
    '\x1B' + '\x4D' + '\x31'// small text
    'EAT ME' + '\x0A',
    '\x1B' + '\x4D' + '\x30'// normal text
    '------------------------------------------' + '\x0A',
    'normal text',
    '\x1B' + '\x61' + '\x30'// left align
    '\x0A' + '\x0A' + '\x0A' + '\x0A' + '\x0A' + '\x0A' + '\x0A',
    '\x1B' + '\x69'// cut paper (old syntax)
    // '\x1D' + '\x56'  + '\x00' // full cut (new syntax)
    // '\x1D' + '\x56'  + '\x30' // full cut (new syntax)
    // '\x1D' + '\x56'  + '\x01' // partial cut (new syntax)
    // '\x1D' + '\x56'  + '\x31' // partial cut (new syntax)
    '\x10' + '\x14' + '\x01' + '\x00' + '\x05'// Generate Pulse to kick-out cash drawer**
    // **for legacy drawer cable CD-005A.  Research before using.
    // see also http://keyhut.com/popopen4.htm
  ];

  if (!qz.websocket.isActive()) {
    qz.websocket
      .connect(undefined)
      .then(() => {
        console.log('socket connected');
        return qz.printers.find();
      })
      .then((printers=> {
        console.log('Printers:'printers);
        let config = qz.configs.create(printers[0]);
        return qz.print(configdata);
      })
      .then(() => {
        return qz.websocket.disconnect();
      })
      .then(() => {
        // process.exit(0);
      })
      .catch((err=> {
        console.error(err);
        // process.exit(1);
      });
  }

Dana nedjelja, 22. studenoga 2020. u 21:11:21 UTC+1, korisnik Lite Finocchiaro napisao je:
Daniel:

Thanks for your interest in QZ-Tray!

Here is a simple example for implementing QZ-Tray's print functionality:


We encourage implementation with 2.1 at this time.

Regards,

Lite Finocchiaro
VP, QZ Industries

On Sun, Nov 22, 2020 at 1:13 PM Daniel Grgić <grgicd...@gmail.com> wrote:
Hello QZ Print Supportter.

I am a web designer and developer from UK and have been developing Food Delivery & Ordering web application for the last 6 months with Node + React.
Now, I want to add function what store owner can print order information on his endpoint when click Print Button with QZ print.
Please let me know how I can implement that function.

Looking forward to hearing back from you soon.
Regards.

--
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-p...@googlegroups.com.

Lite Finocchiaro

unread,
Nov 25, 2020, 3:30:09 AM11/25/20
to Daniel Grgić, qz-print
Daniel:

Please give a more detailed explanation of the error or provide logs from QZ-Tray.

There are many things that could cause ESC/POS not to print correctly, and I don't want to make any assumptions. 

Sharing your operating system and printer model will also be helpful.

Cheers,

Lite




To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qz-print/3feae495-07e2-4e3c-ba95-34dd4e07ef06o%40go

grgicd...@gmail.com

unread,
Nov 25, 2020, 5:03:00 AM11/25/20
to qz-print
Please check attached screenshot. I tested with ESC/POS test code of the guide with remove image: 'data', data: 'assest/img/image_sample_bw.png'.
Environtment : OS : MAC, Printer Device: StarPrinter

grgicd...@gmail.com

unread,
Nov 25, 2020, 5:08:32 AM11/25/20
to qz-print
Actually, I want to implement function that print dynamic information order to the customer's raw printer. that don't includes image and include some difference font size and font-weight. Can you explain me what is the best way and code sample for that within today ?
That will help me greatly, I have to complete that function within today.
Thanks in advance.

Tres Finocchiaro

unread,
Nov 25, 2020, 10:45:35 AM11/25/20
to Daniel Grgić, qz-print
Daniel,

This public mailing list is offered as a courtesy.  If you have immediate support needs, we offer that at buy.qz.io.

In regards to your issue about fonts, Lite's documented a bunch of ESC/POS commands including the text size here: https://qz.io/wiki/2.1-Raw-Printing#escpos

Alternatively you can try to use something like our HTML or PDF processor via our "Pixel" examples.


To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qz-print/43471898-0296-4b30-a957-6708a051da84o%40googlegroups.com.

Lite Finocchiaro

unread,
Nov 25, 2020, 11:45:13 AM11/25/20
to Tres Finocchiaro, Daniel Grgić, qz-print
Daniel:

What is the printer model? This is important because:

1. The Star TSP100/143 cannot process ESC/POS commands on MacOS, for example. It will only work in Windows with the Star driver.

2. The Star TSP654 (and many other Star thermal receipt printers) has a dip switch on the bottom of the printer to switch between "Star Line Mode" and ESC/POS.  If the switch is set to the wrong side, it will not print all ESC/POS commands.

ESC/POS fonts are explained in the ESC/POS programming guide. Our code snippets are offered as a courtesy.

Also, please share code, not screenshots. :) If you can show us the code you're using to find the printer and send the data we can identify errors and make recommendations.

Regards,

Lite Finocchiaro

grgicd...@gmail.com

unread,
Nov 30, 2020, 3:12:04 AM11/30/20
to qz-print
H, How are you?
I am integrating the qz printer into my e-commerce ordering system.
But I have some issues and questions of printing the context with styling... like border, font size, etc...
As the printing content will be changed dynamically according to the order, we can't make a static html, or pdf file.
Now, I am able to print the normal order contents using Raw Printing Generic.
https://qz.io/wiki/2.1-raw-printing#generic
But I can't make some texts to bold and bigger size.
My printer is "Star TSP143IIIU"
https://www.thebarcodewarehouse.co.uk/shop/star/receipt-printers/39472390/Please let me know how to make the styles of texts.
Thanks.

Dana srijeda, 25. studenoga 2020. u 17:45:13 UTC+1, korisnik Lite Finocchiaro napisao je:
Daniel:

What is the printer model? This is important because:

1. The Star TSP100/143 cannot process ESC/POS commands on MacOS, for example. It will only work in Windows with the Star driver.

2. The Star TSP654 (and many other Star thermal receipt printers) has a dip switch on the bottom of the printer to switch between "Star Line Mode" and ESC/POS.  If the switch is set to the wrong side, it will not print all ESC/POS commands.

ESC/POS fonts are explained in the ESC/POS programming guide. Our code snippets are offered as a courtesy.

Also, please share code, not screenshots. :) If you can show us the code you're using to find the printer and send the data we can identify errors and make recommendations.

Regards,

Lite Finocchiaro
On Wed, Nov 25, 2020 at 10:45 AM Tres Finocchiaro <tres.fi...@gmail.com> wrote:
Daniel,

This public mailing list is offered as a courtesy.  If you have immediate support needs, we offer that at buy.qz.io.

In regards to your issue about fonts, Lite's documented a bunch of ESC/POS commands including the text size here: https://qz.io/wiki/2.1-Raw-Printing#escpos

Alternatively you can try to use something like our HTML or PDF processor via our "Pixel" examples.

--
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-p...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages