0

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.

2
  • The printer always prints in the order received. If that is not you are observing, it's not the printer's fault. How are you sending the labels? Commented Mar 19, 2024 at 19:30
  • I'm pretty sure I send them in order. I think browser printer might have a bug changing the order doing some async print. Even if I send the labels in order, I think bowser print handles them at the same time giving random positions to each label Commented Mar 19, 2024 at 21:30

1 Answer 1

0

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.