Printing QR code on ticketprinters
Moderator: Rathinagiri
- serge_girard
- Posts: 3420
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Printing QR code on ticketprinters
Anybody knows how to print (existing) QR code on Epson (or similar) ticketprinters?
Serge
Serge
There's nothing you can do that can't be done...
Re: Printing QR code on ticketprinters
Hi Serge, I can send a picture ... .jpg to my ticket printer star tsp100. It is wrong size, but you could resize.
I am sure you have thought of this. Maybe can work.
I am sure you have thought of this. Maybe can work.
All The Best,
Franco
Canada
Franco
Canada
- serge_girard
- Posts: 3420
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: Printing QR code on ticketprinters
I now use (in batch file: net use lpt1: \\pc.\EPSON) and then
Serge
Code: Select all
SET PRINTER TO LPT2
SET DEVICE TO PRINTER
SET PRINTER ON
? some codes
? 'my text'
// now how send JPG to ?
There's nothing you can do that can't be done...
Re: Printing QR code on ticketprinters
Serg, I use this in my programs for printing pictures. I ran out of paper in my ticket printer so can not test right now.
But this works. Not sure if you can use. Just compile. I use 3.44.
I just went on internet and copied a sample qrcode then saved as png and jpg and put files in this folder..
But this works. Not sure if you can use. Just compile. I use 3.44.
I just went on internet and copied a sample qrcode then saved as png and jpg and put files in this folder..
Code: Select all
#include "hmg.ch"
#include "bostaurus.ch"
FUNCTION Main()
LOCAL CImagep := "serg.png"
LOCAL Cimagej := "serg.jpg"
IF ! FILE( cImagep ) .OR. ! FILE( cimagej)
MsgInfo( "Image not found: " + cImage )
RETURN NIL
ENDIF
SELECT HPDFDOC 'P.PDF' PAPERLENGTH 60 PAPERWIDTH 40
START HPDFDOC
START HPDFPAGE
*SET HPDFDOC ENCODING TO "WinAnsiEncoding"
@ 5, 2 HPDFPRINT 'Hello Serg' size 12
@ 15,1 HPDFPRINT IMAGE cimagep WIDTH 30 HEIGHT 30 type PNG
@ 50, 10 HPDFPRINT 'Ping Style' size 12
@ 60 ,1 HPDFPRINT IMAGE cimagej WIDTH 30 HEIGHT 30 type JPG
@ 95, 10 HPDFPRINT 'Jpg Style' size 12
@ 125,2 HPDFPRINT 'Ping Style' SIZE 12
@ 115,40 HPDFPRINT IMAGE cimagep WIDTH 20 HEIGHT 20 type PNG
@ 150,2 HPDFPRINT 'Jpg Style' size 12
@ 140,40 HPDFPRINT IMAGE cimageJ WIDTH 20 HEIGHT 20 type JPG
END HPDFPAGE
END HPDFDOC
EXECUTE FILE 'P.PDF'
RETURN NIL
Last edited by franco on Sun Jan 25, 2026 11:36 pm, edited 1 time in total.
All The Best,
Franco
Canada
Franco
Canada
- serge_girard
- Posts: 3420
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: Printing QR code on ticketprinters
Thanks! I will try as soon as I have my printer.
Serge
Serge
There's nothing you can do that can't be done...
Re: Printing QR code on ticketprinters
Got it working. you may have to play with size. When you print you print actual size. It makes it clearer. Not sure how to program this.
I just right click in file and print. You could pick laser printer to try. I use Star tsp100 cutter printer.
I just right click in file and print. You could pick laser printer to try. I use Star tsp100 cutter printer.
Code: Select all
#include "hmg.ch"
#include "bostaurus.ch"
FUNCTION Main()
LOCAL cPrinter := 'default' , LSUCCESS
LOCAL CImagep := "serg.png"
LOCAL Cimagej := "serg.jpg"
IF ! FILE( cImagep ) .OR. ! FILE( cimagej)
MsgInfo( "Image not found: " + cImage )
RETURN NIL
ENDIF
SELECT HPDFDOC 'P.PDF' PAPERLENGTH 60 PAPERWIDTH 40
START HPDFDOC
START HPDFPAGE
*SET HPDFDOC ENCODING TO "WinAnsiEncoding"
@ 5, 10 HPDFPRINT 'Hello Serg' size 16
@ 15,1 HPDFPRINT IMAGE cimagep WIDTH 30 HEIGHT 30 type PNG
@ 50, 10 HPDFPRINT 'Ping Style' size 16
@ 60 ,1 HPDFPRINT IMAGE cimagej WIDTH 30 HEIGHT 30 type JPG
@ 95, 10 HPDFPRINT 'Jpg Style' size 16
END HPDFPAGE
END HPDFDOC
EXECUTE FILE 'P.PDF'
RETURN NIL
All The Best,
Franco
Canada
Franco
Canada
Re: Printing QR code on ticketprinters
I tested it with my Samsung phone after printing. All print outs above work. HP laser printer and star ticket printer.
All The Best,
Franco
Canada
Franco
Canada
- serge_girard
- Posts: 3420
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: Printing QR code on ticketprinters
Serge, I think that your printer uses ESC/P2 codes.
You should study documentation
https://support2.epson.net/manuals/engl ... PCOM_3.HTM
In my opinion, it would be the best generate first binary file with all you want to print and then send it to printer:
You should study documentation
https://support2.epson.net/manuals/engl ... PCOM_3.HTM
In my opinion, it would be the best generate first binary file with all you want to print and then send it to printer:
Code: Select all
function FilePrint
param cFileName, cPrintJobTitle, cPrinter
local aDrukarki := aPrinters()
if cPrinter = NIL
cPrinter := WIN_PRINTERGETDEFAULT()
endif
if empty(cPrinter)
cPrinter := WIN_PRINTERGETDEFAULT()
endif
if aScan( aDrukarki, cPrinter) = 0
cPrinter := WIN_PRINTERGETDEFAULT()
endif
if type("cPrintJobTitle") <> "C"
cPrintJobTitle := "Wydruk z programu FAKTURY " + WersjaProgramu
endif
WIN_PRINTFILERAW( cPrinter, cFileName, cPrintJobTitle )
return .f.
- serge_girard
- Posts: 3420
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: Printing QR code on ticketprinters
Thanks !
When that pirnter is my office I will continue this case,
Serge
When that pirnter is my office I will continue this case,
Serge
There's nothing you can do that can't be done...