Hello all
I need help about printing the EAN 128 barcode
Please help me
Best Regards
help about print barcode EAN 128
- James Bott
- Posts: 4840
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
- armando.lagunas
- Posts: 346
- Joined: Mon Oct 05, 2009 3:35 pm
- Location: Curico-Chile
- Contact:
Re: help about print barcode EAN 128
init the program
to use:
functions:
works fine in the programs! and printers
Code: Select all | Expand
#translate @ <nRow>, <nCol> CODE128 <cCode> [ MODE <cMode>] [ <lVert:VERTICAL> ] [ COLOR <nColor> ] [ WIDTH <nWidth> ] [ SIZE <nSize> ] [ OF <oPrint>] => ;
Code128( <nRow>, <nCol> , <cCode>, <oPrint>, <cMode>,<nColor>, .not. <.lVert.>, <nWidth>, <nSize> )
to use:
Code: Select all | Expand
// RESOLUTION IN PIXEL
PRINTER oPrn NAME "Tarja"
x := oPrn:nVertRes() / 100
PAGE
oPrn:Say( x * 08, 50 , "PRODUCT " , oFont[16],,,,0) ; oPrn:Say( x * 08, 250, UPPER(ALLTRIM(PA10->LIN1)) , oFont[16],,,,0)
oPrn:Say( x * 17, 50 , "VARIETY" , oFont[15],,,,0) ; oPrn:Say( x * 17, 250, UPPER(ALLTRIM(PA10->VARI)) , oFont[15],,,,0)
->> @ x*60,500 CODE128 "123456789012345678" MODE "A" SIZE 1.35 WIDTH 0.018 OF oPrn
ENDPAGE
ENDPRINT
functions:
Code: Select all | Expand
STATIC aCode :={ "212222", "222122", "222221", "121223", "121322", "131222", ;
"122213", "122312", "132212", "221213", "221312", "231212", ;
"112232", "122132", "122231", "113222", "123122", "123221", ;
"223211", "221132", "221231", "213212", "223112", "312131", ;
"311222", "321122", "321221", "312212", "322112", "322211", ;
"212123", "212321", "232121", "111323", "131123", "131321", ;
"112313", "132113", "132311", "211313", "231113", "231311", ;
"112133", "112331", "132131", "113123", "113321", "133121", ;
"313121", "211331", "231131", "213113", "213311", "213131", ;
"311123", "311321", "331121", "312113", "312311", "332111", ;
"314111", "221411", "431111", "111224", "111422", "121124", ;
"121421", "141122", "141221", "112214", "112412", "122114", ;
"122411", "142112", "142211", "241211", "221114", "213111", ;
"241112", "134111", "111242", "121142", "121241", "114212", ;
"124112", "124211", "411212", "421112", "421211", "212141", ;
"214121", "412121", "111143", "111341", "131141", "114113", ;
"114311", "411113", "411311", "113141", "114131", "311141", ;
"411131", "211412", "211214", "211232", "2331112" }
//----------------------------------------------------------------------
FUNCTION Code128( nRow, nCol, cCode, oPrint, cMode, Color, lHorz, nWidth, nHeigth )
Mode128( Barras (cCode, cMode), nRow, nCol, oPrint, lHorz, Color, nWidth, nHeigth )
RETURN nil
//----------------------------------------------------------------------
FUNCTION Mode128( cBarra, nx,ny,oPrint,lHoRz, nColor, nWidth, nLen)
LOCAL n, oBr
DEFAULT lHorz := .t. , ;
nWidth := 0.025, ;
nLen := 1.5
IF EMPTY( nColor ) ; nColor := CLR_BLACK ; ENDIF
DEFINE BRUSH oBr COLOR nColor
IF !lHorz ; nWidth := ROUND( nWidth * 10 * oPrint:nVertRes() / oPrint:nVertSize() ,0 )
ELSE ; nWidth := ROUND( nWidth * 10 * oPrint:nHorzRes() / oPrint:nHorzSize(), 0 )
ENDIF
IF lHorz ; nLen := ROUND( nLen * 10 * oPrint:nVertRes() / oPrint:nVertSize() ,0 )
ELSE ; nLen := ROUND( nLen * 10 * oPrint:nHorzRes() / oPrint:nHorzSize(), 0 )
ENDIF
FOR n:=1 TO LEN(cBarra)
IF SUBSTR(cBarra, n, 1) ='1'
IF lHorz ; oPrint:fillRect({nx,ny,nx+nLen,(ny+=nWidth)},oBr)
ELSE ; oPrint:fillRect({nx,ny,(nx+=nWidth),ny+nLen},oBr)
ENDIF
ELSE
IF lHorz ; ny += nWidth
ELSE ; nx += nWidth
ENDIF
ENDIF
NEXT
oBr:End()
RETURN Nil
//----------------------------------------------------------------------
FUNCTION Barras( cCode, cMode )
LOCAL nSum := 0, cBarra, cCar, cTemp, n, nCAr, nCount:=0, lCodeC := .f. ,lCodeA:= .f.
IF cMode =="C" ; lCodeC := .t. ; cTemp := aCode[106] ; nSum := 105
ELSEIF cMode =="A" ; lCodeA := .t. ; cTemp := aCode[104] ; nSum := 103
ELSE ; cTemp := aCode[105] ; nSum := 104
ENDIF
nCount := 0
FOR n := 1 TO LEN(cCode)
nCount ++ ; cCar := SUBSTR(cCode, n, 1)
IF lCodeC
IF LEN(cCode) = n ; cTemp += aCode[101] ; nCar := ASC(cCar) - 31
ELSE ; nCar := VAL(SUBSTR(cCode, n, 2)) + 1 ; n++
ENDIF
ELSEIF lCodeA
if cCar> "_" ; cTemp += aCode[101] ; nCar := ASC(cCar) - 31
ELSEIF cCar <= " " ; nCar := ASC(cCar) + 64
ELSE ; nCar := ASC(cCar) - 31
ENDIF
ELSE
IF cCar <= " " ; cTemp += aCode[102] ; nCar := ASC(cCar) + 64
ELSE ; nCar := ASC(cCar) - 31
ENDIF
ENDIF
nSum += ( nCar - 1 ) * nCount ; cTemp := cTemp + aCode[nCar]
NEXT
nSum := nSum%103 + 1
cTemp := cTemp + aCode[ nSum ] +aCode[107]
cBarra := ""
FOR n:=1 TO LEN( cTemp ) STEP 2
cBarra += REPLICATE('1',VAL(SUBSTR(cTemp, n , 1)))
cBarra += REPLICATE('0',VAL(SUBSTR(cTemp, n+1, 1)))
NEXT
RETURN cBarra
works fine in the programs! and printers
SkyPe: armando.lagunas@hotmail.com
Mail: armando.lagunas@gmail.com
Mail: armando.lagunas@gmail.com
Re: help about print barcode EAN 128
Thanks Armando
i have insert your code and test the barcode
it's ok
but the barcode that i need is GS1-128/EAN-128
it's a variant of code128
the ean128 that i need to print is
(01)18005696016976(17)141130(10)1312(94)21248122
http://en.wikipedia.org/wiki/GS1-128
if you help me thanks you
i have insert your code and test the barcode
it's ok
but the barcode that i need is GS1-128/EAN-128
it's a variant of code128
the ean128 that i need to print is
(01)18005696016976(17)141130(10)1312(94)21248122
http://en.wikipedia.org/wiki/GS1-128
if you help me thanks you
Re: help about print barcode EAN 128
I have insert the FNC1 code but the barcode is non-readeable
if you remove the FNC1 code the barcode is readeable
format of barcode is
START + FNC1 + [ ( AI + DATA + CHECK ) ... ] + STOP
Best regards
if you remove the FNC1 code the barcode is readeable
format of barcode is
START + FNC1 + [ ( AI + DATA + CHECK ) ... ] + STOP
Best regards
- armando.lagunas
- Posts: 346
- Joined: Mon Oct 05, 2009 3:35 pm
- Location: Curico-Chile
- Contact:
Re: help about print barcode EAN 128
i am sorry, but my program, generates random numbers automatically depending of the lots production, experience the inserted letters or symbols not yet works...
SkyPe: armando.lagunas@hotmail.com
Mail: armando.lagunas@gmail.com
Mail: armando.lagunas@gmail.com
- Silvio.Falconi
- Posts: 7138
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: help about print barcode EAN 128
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com