receipt-print-hq / escpos-tools

Utilities to read ESC/POS print data
MIT License
201 stars 73 forks source link

Support for QR codes #59

Open bblimke opened 5 years ago

bblimke commented 5 years ago

Hi,

Does esc2html command support QR codes?

mike42 commented 5 years ago

Not currently. The parser knows how to skip past the commands, but we don't use a library to turn them into images for HTML output yet.

We have one test file (qr-code.bin from escpos-php) which uses a 2D data command for QR codes, but shows only blanks.

image

It would be possible to add support for some types of QR code fairly easily.

Do you have any example binary files that contain QR codes which could be used for testing such a feature?

bblimke commented 5 years ago

Hi @mike42

I have ended up generating QR codes as images and then adding them as images.

Here is an example of escpos file with QR code:

qr_code.escpos.gz

gelinger777 commented 3 years ago

@bblimke where do you add them? And how you distiguish the QR inside the lines? Could you share some code please?

bblimke commented 3 years ago

@gelinger777 QR is not supported and I don't remember how to distinguish them. I ended up producing escpos files with images of QR codes instead of QR codes.

gelinger777 commented 3 years ago

problem is that different manufacturers have different commands which should be sent before the qr code string and after it. If we could achive at least that on epson/metapace and 2 other major manufacturer's qr codes would be detected and replaced with base64 images would be great imho...