barcode

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
fouednoomen
Posts: 188
Joined: Sun Oct 14, 2012 8:33 am
DBs Used: DBF, MySQL, MariaDB, SQLite, PostgreSQL, Oracle, ODBC
Location: Tunisia

barcode

Post by fouednoomen »

dear All

i try to use this sample in my application to display barcode.

but i got this strange result please help
Attachments
EAN13.rar
(30.66 KiB) Downloaded 466 times
ean13.jpg
ean13.jpg (21.74 KiB) Viewed 6474 times
User avatar
tave2009
Posts: 61
Joined: Tue Jul 14, 2009 3:33 am
Location: San Francisco, Córdoba, Argentina.

Re: barcode

Post by tave2009 »

No hay problema:

Con el explorador de windows buscá el archivo "EAN13_0.TTF", doble click sobre el.
Se abre una pantalla, click en el botón "Instalar", listo. Corré tu programa y magicamente
aparece el código de barras.

Traducción Google:

No problem:

With Windows Explorer locate the file "EAN13_0.TTF", double click on the.
A screen opens, click on the "Install" ready. Run your program and magically
bar code appears.

Saludos
Walter
Nada se pierde. Todo se transforma. (Lavoussier)
Nothing is lost. Everything changes.
User avatar
danielmaximiliano
Posts: 2612
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: barcode

Post by danielmaximiliano »

Hello fouednoomen
morning I prepared an example to implement GS1 EAN improved in its application.
can read a bit this thread.
would be good to their profile that aggregates current place to know a little more.

Friend Mol : http://hmgforum.com/viewtopic.php?f=9&t=2555

Me : http://hmgforum.com/viewtopic.php?f=15&t=2439

Me : http://hmgforum.com/viewtopic.php?f=9&t=2449
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
mol
Posts: 3720
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: barcode

Post by mol »

Printing EAN-13 is more complicated than use only proper font.
You need do read more about it, because first 6 digits could appear in A or B variant.
User avatar
danielmaximiliano
Posts: 2612
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: barcode

Post by danielmaximiliano »

mol wrote:Printing EAN-13 is more complicated than use only proper font.
You need do read more about it, because first 6 digits could appear in A or B variant.
El codigo susminstrado para comprobar los digitos es preciso mas las rutina de comprobacion de digito ya tiene como para empezar, en mi caso la impresora fiscal que utilizamos HASAR 715F imprime mediante esos codigo de impresion(Fuente de letra) y es reconocida por los distintos lectores de barra, tanto de mano como de mesa.

The most supply for checking code digits plus the routine must check digit and is to start, in my case the fiscal printer Hasar 715F use by those printing code (Font Letter) and is recognized by different readers bar, both handheld and table.
715.png
715.png (51.04 KiB) Viewed 6426 times

Code: Select all

aadd( aTab1CodBar, '-AAAAAA' )
  aadd( aTab1CodBar, '-AABABB' )
  aadd( aTab1CodBar, '-AABBAB' )
  aadd( aTab1CodBar, '-AABBBA' )
  aadd( aTab1CodBar, '-ABAABB' )
  aadd( aTab1CodBar, '-ABBAAB' ) 
  aadd( aTab1CodBar, '-ABBBAA' )
  aadd( aTab1CodBar, '-ABABAB' )
  aadd( aTab1CodBar, '-ABABBA' )
  aadd( aTab1CodBar, '-ABBABA' )

Code: Select all

*----------------------------                    /**********************************************************/ 
Procedure Check()   
*----------------------------
   
** Primer dígito  
cLitCD := LEFT( Stock.Text_1.Value , 1 )

** Dígitos del 2 al 7
For nCounter = 2 to 7
   cLetraTabla := SUBST( aTab1CodBar[ VAL( LEFT( Stock.Text_1.Value , 1 ) ) + 1 ] , nCounter , 1 )
   if cLetraTabla = "A"
      cLitCD += chr( 65 + VAL( SUBST( Stock.Text_1.Value , nCounter , 1 ) ) )
   else // "B"
      cLitCD += chr( 75 + VAL( SUBST( Stock.Text_1.Value , nCounter , 1 ) ) )
   endif
Next 

cLitCd += "*"

** Dígitos del 8 al 13
For nCounter = 8 to 13
   cLitCD += chr( 97 + VAL( SUBST( Stock.Text_1.Value , nCounter , 1 ) ) )
Next

cLitCD += "+"
Stock.cCodeFinal.value := cLitCD
*Stock.cCodeFinal.REFRESH

Return

Code: Select all

Function GTIN_CHECK(cCode) 
Local  nTop     := iif( Len( cCode ) >= 12 , 6 , 4 )
Public nControl := 0
Public nFor     := 0
Public nPair    := 0                                        
Public nOdd     := 0

   for nFor= 1 to nTop
      nPair  := nPair + val( subst( cCode,( nFor * 2 )    , 1 ) )    // suma de pares     // Sum Digits Pair
      nOdd   := nOdd  + val( subst( cCode,( nFor * 2 ) - 1, 1 ) )    // suma de impares   // Sum Digits odd
   next
   //          7 7 9 8 1 3 8 5 5 0 9 4 0
   // Pair :=    9 + 8 + 3 + 5 + 0 + 4 = 29 * 3 =  87
   // Odd  :=  7 + 9 + 1 + 8 + 5 + 9   = 49     +  49
   // Control                                     136
           
   If nTop == 6         
   nControl :=  nPair * 3 
   nControl :=  nControl + nOdd
   nControl := Int( 10 -  Mod(nControl , 10 ) )             // Mod( nControl , 10 )     
   Else 
   nControl :=  nOdd  * 3 
   nControl :=  nControl  + nPair    
   nControl :=  Int( 10 - Mod(nControl , 10 ) )  
   Endif 

   If nControl = 10 
      nControl = 0
   Endif
   
   
    
Return Alltrim( Str( nControl , 1 ) )


The code contains errors "S U B S T R" because the server will not let me put this code for DOS attacks

The TTF font used is in the folder " \EAN13\Fuentes necesarias
If you need anything else just have to comment that try to help
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
fouednoomen
Posts: 188
Joined: Sun Oct 14, 2012 8:33 am
DBs Used: DBF, MySQL, MariaDB, SQLite, PostgreSQL, Oracle, ODBC
Location: Tunisia

Re: barcode

Post by fouednoomen »

Dear All Friend

Many thanks for your prompt replay

Now it's Run


Foued
hkrasser
Posts: 16
Joined: Fri Jul 10, 2009 12:08 pm
Location: Austria

Re: barcode

Post by hkrasser »

I have prepared another test-program for You.
Please note, that You have to Copy the Font "ean13.ttf" in the directory \windows\fonts ( in XP )

Good luck with Ean-Printing!
Attachments
Barcode_Kra2.zip
Barcode_Kra2.PRG and ean13.ttf
(5.24 KiB) Downloaded 552 times
User avatar
fouednoomen
Posts: 188
Joined: Sun Oct 14, 2012 8:33 am
DBs Used: DBF, MySQL, MariaDB, SQLite, PostgreSQL, Oracle, ODBC
Location: Tunisia

Re: barcode

Post by fouednoomen »

Many Thanks My friend

It's Run very well

:D
Regards

Fouad
Post Reply