QR

This forum is for eXpress++ general support.
Message
Author
MIGUELON
Posts: 153
Joined: Wed Feb 10, 2010 10:55 am

QR

#1 Post by MIGUELON »

Hello everyone, I need to print a QR code on a thermal receipt printer.
Although I can generate the QR code, when I try to print it using "dcprint bitmap filename", it doesn't work. I've tried several formats: BMP, PNG, and JPG, but it doesn't print in any of them. The receipt header logo prints without problems, and it's in JPG format.
The problem might be with the parameters @ <nSrow>, <nScol> [, <nErow>, <nEcol> ], but no matter how many times I try, the QR code doesn't appear; it just leaves a blank space. Since I urgently need to print this QR code, another solution would be to find some QR code fonts, and that's where I need help. Do you know where I can buy a QR code font?

Thanks to all.
Attachments
VF_QR.PNG
VF_QR.PNG (444 Bytes) Viewed 1398 times

User avatar
SlavkoDam
Posts: 151
Joined: Wed Apr 27, 2022 10:12 am
Location: Negotin, Serbia
Contact:

Re: QR

#2 Post by SlavkoDam »

Hi,
You should generate and print QR code in GIF format.
Slavoljub Damnjanovic
SD-SoftDesign, Alaska Software Technology Partner
https://www.sd-softdesign.com
https://www.sd-softdesign.rs

MIGUELON
Posts: 153
Joined: Wed Feb 10, 2010 10:55 am

Re: QR

#3 Post by MIGUELON »

Thanks for the suggestion, but it doesn't work in GIF format either.

User avatar
Tom
Posts: 1303
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: QR

#4 Post by Tom »

You can't simply use a font for QR-barcodes, since they use one direction too much for fonts.

Although I use a report generator (List&Label), which is able to generate all kinds of barcodes on the fly, I still have three or four old forms created with DCPRINT there and there. It should work with

Code: Select all

 DCPRINT BITMAP <cFileName> AUTOSCALE
Don't forget to include the full path in the filename.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
SlavkoDam
Posts: 151
Joined: Wed Apr 27, 2022 10:12 am
Location: Negotin, Serbia
Contact:

Re: QR

#5 Post by SlavkoDam »

It doesn't work in GIF format either.
It is possibly a problem with DCPRINT which you use. My PowerWin library has PIMAGE() function which can print image in any format, including ICO. I use it to print QR code on a thermal receipt printer in my application for cash register. You can download test version of PowerWin library and try it.
Slavoljub Damnjanovic
SD-SoftDesign, Alaska Software Technology Partner
https://www.sd-softdesign.com
https://www.sd-softdesign.rs

User avatar
rdonnay
Site Admin
Posts: 4875
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: QR

#6 Post by rdonnay »

I have never seen any problem with QR codes printing using DCPRINT.

Here is an example of a receipt that is printed by the Medallion program.
The output goes to a PDF file by using the Microsoft PDF Printer.

Code: Select all

   IF nPage == 1 .AND. Alltrim(GetFlg('FLAG32')) == 'Y'

     @ nRow -20, 10, nRow + 620, 400 DCPRINT ;
           BITMAP IniGet('RECEIPTS','ReceiptImagesPath') + '\QR-Code-(iphone)-Referral-edit.Jpg'

     @ nRow + 40, 1550, nRow + 600, 2050 DCPRINT ;
           BITMAP IniGet('RECEIPTS','ReceiptImagesPath') + '\My_Social_Media_QR-edit.Jpg'

   ENDIF
qrcode_receipt.JPG
qrcode_receipt.JPG (69.04 KiB) Viewed 1366 times
The eXpress train is coming - and it has more cars.

User avatar
PedroAlex
Posts: 247
Joined: Tue Feb 09, 2010 3:06 am

Re: QR

#7 Post by PedroAlex »

Hello,
I've had a lot of work with QR codes.
I started by acquiring a library for that purpose. Alaska didn't have a solution.
A few years later, it's now possible to create QR codes using only Alaska-Xbase (asset available).
You can create them in any format and print them with DCprint.
But you can also simply send ESC sequences to produce the QR code on a receipt printer. ( This is the best quality and faster solution )
What do you need? Do you have an EPSON receipt printer?

You can read this post, maybe it will help.
http://bb.donnay-software.com/Donnay/vi ... E&start=10
Last edited by PedroAlex on Wed Oct 29, 2025 10:32 am, edited 1 time in total.
Pedro Alexandre

MIGUELON
Posts: 153
Joined: Wed Feb 10, 2010 10:55 am

Re: QR

#8 Post by MIGUELON »

Hi Roger, this is my code:
QrCode(cCadenaQR,cDirectorioFicheroQR,.f.)

if file(cDirectorioFicheroQR)

/ message(cDirectorioFicheroQR)

@ dc_printerrow()-20,10,dc_printerrow()+620,400 DCPRINT BITMAP cDirectorioFicheroQR

endif
The qrCode function generates a QR code in JPG format.
As you can see, I've used your data in the row and column.

The problem is that it prints a blank copy. I'm sending you an image of what the ticket looks like. As you can see, it leaves the QR code space but doesn't print it.
Attachments
WhatsApp Image 2025-10-29 at 18.13.23.jpeg
WhatsApp Image 2025-10-29 at 18.13.23.jpeg (117.71 KiB) Viewed 1351 times

User avatar
PedroAlex
Posts: 247
Joined: Tue Feb 09, 2010 3:06 am

Re: QR

#9 Post by PedroAlex »

Try,

@ dc_printerrow()-20,10,dc_printerrow()+620,400 DCPRINT BITMAP cDirectorioFicheroQR AUTOSCALE CENTER

or try this

@ 00,05, 07,45 DCPRINT BITMAP cFileQRCode AUTOSCALE CENTER ( just for check if the bitmap is OK, maybe is too big )
Pedro Alexandre

Volker
Posts: 6
Joined: Sun Mar 14, 2010 9:01 am

Re: QR

#10 Post by Volker »

Hi,

it is possible to print a QR code using esc/pos commands.

An Epson-compatible thermal printer can generate a QR code with the following code:

CHR(29)+CHR(107)+CHR(11)+CHR(76)+CHR(65)+CHR44)+"This is a test"+CHR(0)

Post Reply