Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

208
Visualizações
How to create ESC/POS barcode with navigator.bluetooth.requestDevice in Javascript

I am trying to get barcode from mobile label printer. But I couldn't get it. I am trying to send esc/pos code using navigator.bluetooth.requestDevice. The printer light is on, but it does not print. Where am I doing wrong? I will be glad if you can help with the issue.

        var esc = '\x1B'; //ESC byte in hex notation
        var newLine = '\x0A'; //LF byte in hex notation

        var zpl = esc + "@"; //Initializes the printer (ESC @)
        zpl += esc + '!' + '\x38'; //Emphasized + Double-height + Double-width mode selected (ESC ! (8 + 16 + 32)) 56 dec => 38 hex
        zpl += 'BEST DEAL STORES'; //text to print
        zpl += newLine + newLine;
        zpl += esc + '!' + '\x00'; //Character font A selected (ESC ! 0)
        zpl += 'COOKIES                   5.00';
        zpl += newLine;
        zpl += 'MILK 65 Fl oz             3.78';
        zpl += newLine + newLine;
        zpl += 'SUBTOTAL                  8.78';
        zpl += newLine;
        zpl += 'TAX 5%                    0.44';
        zpl += newLine;
        zpl += 'TOTAL                     9.22';
        zpl += newLine;
        zpl += 'CASH TEND                10.00';
        zpl += newLine;
        zpl += 'CASH DUE                  0.78';
        zpl += newLine + newLine;
        zpl += esc + '!' + '\x18'; //Emphasized + Double-height mode selected (ESC ! (16 + 8)) 24 dec => 18 hex
        zpl += '# ITEMS SOLD 2';
        zpl += esc + '!' + '\x00'; //Character font A selected (ESC ! 0)
        zpl += newLine + newLine;
        zpl += '11/03/13  19:53:17';
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda