zebra-printersthermal-printerzpl

Zebra Browser Print, labels did not print in numbered order


We have numbered labels that we want to print with Browser print, we send each label like this:

^XA^FO100,100^A0N,50,50^FD Label: 1^FS^XZ
^XA^FO100,100^A0N,50,50^FD Label: 2^FS^XZ
^XA^FO100,100^A0N,50,50^FD Label: 3^FS^XZ

But the printed labels are never in order and it's random, for example 3,1,2.

Does anyone know a ZPL command to set the numbering of each label for the printer to print them in the order defines 1,2,3, ...etc. or any other solution? I thought about the possibility to send a delay for each label, but I think that would be my last resource, anyway, I'm not sure how to establish delays.

After reading the documentation, the most similar topic talks about the sync/async:

Queued Communication JavaScript is asynchronous, but the printer is not. Sending multiple query commands to the printer in succession will most likely result in all of the responses being concatenated together into the response of the first read attempted

The Zebra.Printer object will manage sending the query commands, reading and parsing the responses, and calling the proper callback methods so that requests are handled one at a time.

For example, if the following code is run:

zebraPrinter.getStatus(function(status){}, function(error){});
zebraPrinter.getConfiguration(function(response){}, function(error){});
zebraPrinter.getSGD("device.friendly_name", function(value){}, function(error){});

Each request command will be sent to the printer, and the response to that command will be read and parsed before the next request is sent. Each request's callback function will only receive the device response for that request.


Solution

  • Finally I ended up merging the ZPL in one big file with all the labels.