I try to implement "hb_zebra_draw" function to create PDF417 barcode. Like I always do I search forum themes and found many useful topics, but when I try those examples in my PC output results are good only for strings in examples. When I put my string as parameter results are:
- Symbol DS9208 2d barcode reader read about 80% of text (cca 160 chars) and on results end put some random numbers
- Cell phone Blink PDF417 barcode reader software does not recognize barcode symbol (read without error only when I put 80% of my text in string)
I put various nFlags in parameter without result.
Here is simplest example provided by Daniel:
- Code: Select all Expand view
- #include "fivewin.ch"
function main()
local oWnd
define window oWnd
activate window oWnd;
on paint( BarCode( hDC ) )
return nil
*
*
*
function BarCode( hDC )
local hZebra,crlf:=chr(13)+chr(10)
local cCode := "testing from fivewin"
local hBrush := CreateSolidBrush( 0 )
cCode:=""
cCode+=("HRVHUB30") +chr(13)
cCode+=("HRK") +chr(13)
cCode+=("000000000021080") +chr(13)
cCode+=("JOHN TRAVOLTA") +chr(13)
cCode+=("SET K.F.REPERA") +chr(13)
cCode+=("91000 OLD TOWN") +chr(13)
cCode+=("PIPING INC.") +chr(13)
cCode+=("MAIN STREET 3") +chr(13)
cCode+=("91000 OLD TOWN") +chr(13)
cCode+=("KR5624020061500033402") +chr(13) // good recognition ends with this line ...
cCode+=("KR05") +chr(13)
cCode+=("7291478581062") +chr(13)
cCode+=("WTER") +chr(13)
cCode+=("OVDNAOULSUGAAVLJE2016") +chr(13)
hZebra := hb_zebra_create_pdf417( cCode, NIL ) //nFlags:=HB_ZEBRA_FLAG_PDF417_LEVEL5 //234567
hb_zebra_draw( hZebra, {| x, y, w, h | ( FillRect( hDC, { y, x, y + h, x + w }, hBrush )) }, 5, 5, 1,4 )
deleteobject( hBrush )
hb_zebra_destroy( hZebra )
return nil
Example put barcode on screen and when I scan with scanner output this result to keyboard buffer (Notepad):
- HRVHUB30
HRK
000000000021080
JOHN TRAVOLTA
SET K.F.REPERA
91000 OLD TOWN
PIPING INC.
MAIN STREET 3
91000 OLD TOWN
KR56240200615000334096176811052410142904390853205523596859123740615750659128006351774866760528021091
Please help, if some of you have tips for this situation or have some commercial idea ...
Boris