Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

296
Vistas
Print ZPL labels with Javascript

Im using this example to print labels: https://www.neodynamic.com/articles/How-to-print-raw-Zebra-ZPL-commands-from-Javascript/ everything its working fine,except that if i want to print more than 1 label per click it dosent allow me to do it, for example if Im using a for or while cycle to print,but everytime the for moves on the alert that Says Print now appears everytime this is how that last part looks like in my code n = 0;

while (n < 2) {
          n ++;

        var cmds =  "^XA";

        cmds += "^FO480,21^ARN,1,90^FD/^FS";  
        cmds += "^FO62,36^AUN,90,100^FDEL ZAPATON^FS";
        cmds += "^FO0,135^ARN,60,14^FDDama 4^FS";
        cmds += "^FO0,200^ARN,60,40^FD^FS";
        cmds += "^BY2,2,100";
        cmds += "^FO10,270^BC^FDE0430601926027^FS";
        cmds += "^FO410,273^AUN,100,75^FD$350.50^FS";
        cmds += "^FO50,20^GB530,120,6,B,0"

        cmds += "^XZ";
        cpj.printerCommands = cmds;


        //Enviar impresion a Zebraimpresora
        cpj.sendToClient()

;

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If you want to print multiple copies just double it up.

var zplStr =
`^XA
^FO480,21^ARN,1,90^FD/^FS
^FO62,36^AUN,90,100^FDEL ZAPATON^FS
^FO0,135^ARN,60,14^FDDama 4^FS
^FO0,200^ARN,60,40^FD^FS
^BY2,2,100
^FO10,270^BC^FDE0430601926027^FS
^FO410,273^AUN,100,75^FD$350.50^FS
^FO50,20^GB530,120,6,B,0
^XZ`;

const numOfCopies = 2;
var cmds = new Array(numOfCopies).fill(zplStr).join("\n");
console.log(cmds)

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda