Thermal printer

How to print QR codes on Thermal printer

Summary: In this post I will show you how to print readable QR codes on a thermal printer (also called ticket printer, pos printer, etc.) using JavaScript and a plugin.

If you have followed my posts, you will know that a long time ago I developed a plugin and I have added new features, until today we print QR codes on a thermal printer.

Some time ago I showed you how to print a ticket /receipt directly from browser, today we will use it to print a QR code.

Print QR codes on a thermal printer

The process is simple, but I recommend to try the hello world example first:

Download the plugin and run it, remember to give it permissions if required. It will be executed in the background.

Then install your printer and make sure it is shared.

Now open an HTML document, include the script and then in another script create a ConectorPluginV3 object like this:

See the gist on github.

You can call the ImprimirCodigoQr method after or before anything, and align it like everything else, just make sure you call it after a Feed.

Remember to put the name of your printer when calling imprimirEn. When testing it in my case it is like this:

Print QR code in thermal printer by using a free plugin to send ESC POS commands

Try it yourself

If you want to generate and print QR codes by yourself without writing any line of code, navigate to this example (remember that the plugin must be running and the printer must be shared).

You can see its code here.


I am available for hiring if you need help! I can help you with your project or homework feel free to contact me.
If you liked the post, show your appreciation by sharing it, or making a donation

parzibyte

Freelancer programmer ready to work with you. Web, mobile and desktop applications. PHP, Java, Go, Python, JavaScript, Kotlin and more :) https://parzibyte.me/

Ver comentarios

  • This looks like it will do exactly what I am looking to accomplish ... however the example page recognizes my thermal printer (Seiko Smart Label 650) but errors out when attempting to print.

    So - I downloaded the plug-in and tried from my own pages and the printer wakes but errors before actually printing anything.

    Is the printer incompatible?- Thoughts?

    I am interested in the pro version of plug in if can get to work
    thx

    • Hi this is from the on-screen example log
      6/14/2020, 11:50:22 PM Cargando lista...
      6/14/2020, 11:50:24 PM Lista cargada
      6/14/2020, 11:50:27 PM Imprimiendo...
      6/14/2020, 11:50:27 PM Al imprimir el código QR tenemos: Impreso correctamente

      I can email you the GET and POST from the console of helpful
      The printer wakes and the print head resets but no printing. (the printer does work for other labels)

Compartir
Publicado por
parzibyte

Entradas recientes

Receipt designer for thermal printers – Free and open source

In the last months I have been working on a ticket designer to print on…

4 months hace

JavaScript: store and read files with the Origin Private File System

In this post you will learn how to use the Origin Private File System with…

7 months hace

JavaScript: download file with fetch

In this post you will learn how to download a file in the background using…

7 months hace

SQLite3 with vanilla JavaScript and OPFS – Hello world

In this post I will show you how to use SQLite3 directly in the web…

9 months hace

Python Thermal Printing: A Comprehensive Guide for Printing on Thermal Printers

In this tutorial, we'll explore how to effortlessly print receipts, invoices, and tickets on a…

10 months hace

Image printing on Thermal printer

When printing receipts on thermal printers (ESC POS) sometimes it is needed to print images…

10 months hace

Esta web usa cookies.