xBase++ QR Code print for tax authorities pruposes.
xBase++ QR Code print for tax authorities pruposes.
Hello people,
Here, the tax authorities published a law that requires printing a QR code on all invoices and business documents, even those that are printed on a receipt.
In my case, I print the tickets in text mode, that is, I use commands like "Dcprint say". I am studying the possibilities that xbase can support to print this type of data in a stable and robust way..
I ask, if any programmer who frequents this forum has any experience in this type of work and if they can make any comments, opinions or technical advice.
Some recommendations or examples can help.
Many Thanks in advance..
Here, the tax authorities published a law that requires printing a QR code on all invoices and business documents, even those that are printed on a receipt.
In my case, I print the tickets in text mode, that is, I use commands like "Dcprint say". I am studying the possibilities that xbase can support to print this type of data in a stable and robust way..
I ask, if any programmer who frequents this forum has any experience in this type of work and if they can make any comments, opinions or technical advice.
Some recommendations or examples can help.
Many Thanks in advance..
Pedro Alexandre
Re: xBase++ QR Code print for tax authorities pruposes.
Hi, Pedro.
Maybe this is a good moment to migrate a professional report writing tool like "List & Label" (www.combit.net), which will increase the quality of your app and provide stuff like 2D-barcodes out of the box and without additional programming. And lots of other features.
It is possible to paint QR-barcodes using the GRA-functions, which for instance can be accessed via DCPRINT BOX.
Here's a project which someone adapted to be used with Visual Foxpro, so it should be possible to move it to Xbase++ aswell: https://zint.github.io/
Maybe this is a good moment to migrate a professional report writing tool like "List & Label" (www.combit.net), which will increase the quality of your app and provide stuff like 2D-barcodes out of the box and without additional programming. And lots of other features.
It is possible to paint QR-barcodes using the GRA-functions, which for instance can be accessed via DCPRINT BOX.
Here's a project which someone adapted to be used with Visual Foxpro, so it should be possible to move it to Xbase++ aswell: https://zint.github.io/
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: xBase++ QR Code print for tax authorities pruposes.
Hi Pedro
attached qrcode program in xbase++ using visual foxpro dll
best regard
Hector Pezoa
attached qrcode program in xbase++ using visual foxpro dll
best regard
Hector Pezoa
- Attachments
-
- qr-vfp.rar
- (267.39 KiB) Downloaded 1154 times
-
- qr-vfp.rar
- (267.39 KiB) Downloaded 1092 times
Re: xBase++ QR Code print for tax authorities pruposes.
Tom,
I appreciate your comments
Hector,
Thank you very much for the example.
I've done some tests.
It seems to me a solution for this case.
I appreciate your comments
Hector,
Thank you very much for the example.
I've done some tests.
It seems to me a solution for this case.
Pedro Alexandre
-
- Posts: 42
- Joined: Mon Dec 23, 2013 2:10 pm
- Contact:
Re: xBase++ QR Code print for tax authorities pruposes.
Sample tested with xbase++,
controlled with QR Scanner
controlled with QR Scanner
Code: Select all
*********************** Functions BarCodeLibrary.DLL ********************************
DLLFUNCTION SetConfiguration(nSize,nType);
USING STDCALL FROM BarCodeLibrary.DLL
DLLFUNCTION GenerateFile(cText,cFileOut);
USING STDCALL FROM BarCodeLibrary.DLL
*********-----------------
Procedure CreateQRCodeImage
Parameters cQrTexte,cRetFileImg,nSizeQR,nTypeQR
BEGIN SEQUENCE
If Empty(nTypeQR)
BREAK
Endif
If Empty(cRetFileImg)
BREAK
Endif
If nSizeQR<2 .Or. nSizeQR>12
MsgBox("Incorrect size: 2 .. 12")
BREAK
Endif
If nTypeQR<0 .Or. nTypeQR>2
MsgBox("Incorrect image type file: 0 .. 2")
BREAK
Endif
MyConfQR:=SetConfiguration(nSizeQR,nTypeQR)
// If Oem, conevrt text to ansi, other : GenerateFile(cQrTexte,cRetFileImg)
MyRetFileQR:=GenerateFile(ConvToAnsiCP(cQrTexte),cRetFileImg)
END SEQUENCE
Return
*********-----------
Procedure TestQr
MyTexte:="Test, It's great QR code (xbase ++)"
MyTexte+=Chr(13)+Chr(10)+Dtoc(Date())+" … "+Time()
MFileImg:="Lazhar.Jpg"
CreateQRCodeImage(Mytexte,MFileImg,6,1)
Return
Re: xBase++ QR Code print for tax authorities pruposes.
This DLL has the limitation of only supporting 255 characters in the string to generate the QRcode.
I need generate a QRCode with 455 chars.
Anybody now other solution?
Many Thanks.
I need generate a QRCode with 455 chars.
Anybody now other solution?
Many Thanks.
Pedro Alexandre
Re: xBase++ QR Code print for tax authorities pruposes.
Pedro,
you can use alternative ActiveX library for printing QR Code, like MW6QRCode or StrokeScribe. Here you find about this:
http://bb.donnay-software.com/donnay/vi ... f=2&t=2761
You can manipulate type/size of QR code and with StrokeScribe you can pass the text in various code type, not only UTF-8.
Regards
Piotr
you can use alternative ActiveX library for printing QR Code, like MW6QRCode or StrokeScribe. Here you find about this:
http://bb.donnay-software.com/donnay/vi ... f=2&t=2761
You can manipulate type/size of QR code and with StrokeScribe you can pass the text in various code type, not only UTF-8.
Regards
Piotr
Re: xBase++ QR Code print for tax authorities pruposes.
Piotr,
Thank you for the tip.
This is the correct way. An external DLL ou activex Control.
Thank you for the tip.
This is the correct way. An external DLL ou activex Control.
Pedro Alexandre
Re: xBase++ QR Code print for tax authorities pruposes.
Problems with the second barcode generated.
STATIC FUNC Genera(pText,pFile)
*******************************
LOCAL nHandle := DllPrepareCall("BarCodeLibrary.DLL",DLL_CDECL,"SetConfiguration")
LOCAL nSize := 6
LOCAL nType := 1 //0=bmp 1=jpg 2=gip
DllExecuteCall(nHandle ,nSize,nType)
o:=DllPrepareCall("BarCodeLibrary.DLL",DLL_CDECL,"GenerateFile")
DllExecuteCall(o,pText,pFile)
DllUnLoad(nHandle)
RETURN .t.
Re: xBase++ QR Code print for tax authorities pruposes.
I do it this way
Code: Select all
Local qr_content := "", ;
qr_bmpfile := "", ;
qr_file := GetTempFileName_a(GetTempPath_a()), ;
qr_done := 0
qr_done:=DllCall("QRCODELIB.DLL", DLL_STDCALL, "FastQRCode",qr_content,qr_file,Pixel132x132)
qr_bmpfile := strtran(qr_file,".tmp",".bmp")
FRename(qr_file,qr_bmpfile)
IF file(qr_bmpfile)
nRow+= 2.5
@ nRow, RBLOCKPOS, nRow + 3.3, d_rs DCPRINT box LINECOLOR GRA_CLR_RED LINEWIDTH 2 PRINTER oPrinter
ENDIF
IF Fexists(qr_file)
FErase(qr_file)
ENDIF
Klaus