How to add 2d barcode to fastreport or fwh/harbour?

How to add 2d barcode to fastreport or fwh/harbour?

Postby ShumingWang » Tue Oct 08, 2024 12:50 am

I searched 2 schemes about add 2d barcode to fastreport
1. add the files into app.exe folder and input into fastreport , then you can direct designt it as a text,a imgge etc.
http://www.pudn.com/Download/item/id/2228698.html
https://download.csdn.net/download/july ... t=FastRepo

FastReport_2D_Codebar\dorado-qrcode-0.2.4-BETA.jar (47812, 2013-05-04)
FastReport_2D_Codebar\dorado-qrcode-sample-0.2.4.war (11143719, 2013-05-04)
FastReport_2D_Codebar\FastReport_2D_Codebar\frx2DBarcode.pas (2819, 2012-11-25)
FastReport_2D_Codebar\FastReport_2D_Codebar\frx2DBarcodeRTTI.pas (1167, 2012-11-25)
FastReport_2D_Codebar\FastReport_2D_Codebar\PtImageRW.dll (684032, 2007-08-20)
FastReport_2D_Codebar\FastReport_2D_Codebar\PtQREncode.dll (45056, 2007-08-20)
FastReport_2D_Codebar\FastReport_2D_Codebar\uQRCode.pas (5837, 2012-07-21)
FastReport_2D_Codebar\zxing-javase2.0.jar (31946, 2013-05-04)
FastReport_2D_Codebar\zxing2.0.jar (430433, 2013-05-04)
FastReport_2D_Codebar\FastReport_2D_Codebar (0, 2013-05-04)
FastReport_2D_Codebar (0, 2013-05-04)

But, I can't find the way how to input fastreport /frh/Harbour/Fwh .

2. use 3 party zinit.dll to get a bitmapn file the call it by fastreport,but the Delphi codes
https://www.cnblogs.com/huixch/p/695657 ... m=referral

Tanks a lots!
Shuming wang
http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
ShumingWang
 
Posts: 464
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Re: How to add 2d barcode to fastreport or fwh/harbour?

Postby ShumingWang » Tue Oct 15, 2024 1:45 am

1.
FUNCTION img2dbarcode()
local h2d
private hlib
hLib = LOADLIBRARY( "zint.dll" )

h2d:=ZBarcode_Create()
//// h2d should has datas: symbology,height,width,bitmap,...
?h2d:symbology
// error: method symbology does not exsist

ZBarcode_Encode_and_buffer(h2d,"abc45",5,0)
//error: will hangup

ZBarcode_print(h2d)


ZBarcode_Delete(h2d)

FREELIBRARY( hLib )
return



dll32 function ZBarcode_Create() as LONG pascal FROM "ZBarcode_Create" lib hlib

dll32 function ZBarcode_Encode_and_Buffer(symbol as LONG ,;
source as LPSTR,length as LONG,rotate_angle as LONG) as LONG pascal FROM "ZBarcode_Encode_and_Buffer" lib hlib
// int ZBarcode_Encode_and_Buffer(struct zint_symbol *symbol,
const unsigned char *source, int length, int rotate_angle);

dll32 function ZBarcode_print(my_symbol as LONG,rotate_angle as LONG) as LONG pascal lib hlib
// int ZBarcode_Print(struct zint_symbol *symbol, int rotate_angle);

dll32 function ZBarcode_Delete(my_symbol as LONG) as LPSTR pascal FROM "ZBarcode_Delete" lib hlib

//-------------------
// import zint.dll --> zint.lib

2.

#include <zint.h>
int load2dc(int argc, char **argv)
{
struct zint_symbol *my_symbol;
my_symbol = ZBarcode_Create();
ZBarcode_Encode_and_Print(my_symbol, argv[1], 0, 0);
//here create out file 2d barcode "out.png"

ZBarcode_Delete(my_symbol);
return 0;
}
HB_FUNC ( LOAD2D)
{
load2dc(hb_parni( 1 ),hb_parc( 2 ));
}

// app.prg
loadh2d(,"12345")

//.....
// Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
//Error: Unresolved external '_ZBarcode_Create' referenced from D:\MY.LIB|my
//Error: Unresolved external '_ZBarcode_Encode_and_Print' referenced from D:\MY.LIB|my
//Error: Unresolved external '_ZBarcode_Delete' referenced from D:\MY.LIB|my


Thanks !
Shuming Wang
http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
ShumingWang
 
Posts: 464
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Re: How to add 2d barcode to fastreport or fwh/harbour?

Postby ShumingWang » Fri Nov 01, 2024 2:24 am

1. Download zint.exe from https://sourceforge.net/projects/zint/files/zint/

WaitRun("zint.exe -d "+csourcestr+" -b 58 -o "+cdir) encode csourcestr:"abcd12345" to directory cdir+"\out.bmp", 58 is 2 demention coderbar brcode .

2.
implib -ae zint.lib zint.dll

#include <zint.h>
int load2dc(char *argv)
{
struct zint_symbol *my_symbol;
my_symbol = ZBarcode_Create();
ZBarcode_Encode_and_Print(my_symbol, argv, 0, 0);
//here only create output file 2d barcode "out.gif"

ZBarcode_Delete(my_symbol);
return 0;
}
HB_FUNC ( LOAD2D)
{
load2dc(hb_parc( 1 ));
}

// app.prg
load2d("abcd12345")
http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
ShumingWang
 
Posts: 464
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 31 guests