Mot exact Résultats par page

Index des mots-clés

AGENDA PERSONNEL
ALBUM PHOTO (Script)
ANTI SPAM
APICULTURE
BAECKEOFFE
BREDELE
BUCHE DE NOEL
C++
CADRE
CASSOULET
CHARLOTTE AUX FRUITS
CODAGE ADRESSES MAIL
CODE 2 DE 5 ENTRELACE
CODE 3 DE 9
CODE 128
CODE PDF417
CODES BARRE
CODE POSTAL
CODES VIDEOTEXT
COLOMBO DE PORC
CONFITURES
CONGOLAIS
CORNICHONS AU VINAIGRE
COUARAIL
CREMES
CRUMBLE
CYBERMUT
DADANT
DATAMATRIX
DDE
DOMBRE
DOUBLE NAT
DYNDNSUPDATE
EAN 13
EAN 128
ELECTRONIQUE
ENVOI DE SMS
ESPACE MEMBRE
EURO
EXEMPLES VB6
FAR
FARCE
FAVORIS
FONCTIONS
FONCTIONS EN C++
GATEAU ROULE
GRATIN LORRAIN
GUACAMOLE
IMPRIMANTES RESEAUX
INSTANCE UNIQUE
KIT VB4
LANGSTROTH
LIQUEUR
MADELEINES
MAISONS
MAQUEREAUX AU VIN BLANC
MAQUEREAUX (Rillettes)
MARINADES
NMEA
NOUGATINE
PAIN
PATE A TARTE
PDF417
PHP
PIC
PLANS DE MAISON
PLANTEUR
POMMES
POULET COCO
PROCEDURES
PROGRAMMATION
RATATOUILLE
RECETTES DE CUISINE
RESSOURCES RESEAUX
RHUBARBE
R.I.B.
RILLETTE DE MAQUEREAUX
ROUTINES
RUCHE
SAUMON EN CROUTE
SCRIPTS
SITES
SLICE
SMS
SOUPE DE COURGE
TABLE PERIODIQUE
TARTE
TATIN (Tarte)
TARTIFLETTE
USB
VIDEOTEXT
VISUAL BASIC
VOIRNOT
WNTIPCFG

Mot exact Résultats par page
I
N
D
E
X

The 2 of 5 interleaved code
 


V
ersion francaise

This code allows only the coding of digits. They are coded 2 by 2 so the number of digits must be even.

Let's learn encoding system.

Exemple of checksum for : 65732
(2 + 7 + 6) x 3 + 3 + 5 = 53 ---> M = 60
60 - 53 = 7
New code with the checksum : 657327 (Note that the number of digits including checksum is even.)

Bar code making.

Since we can create the bar code pattern it remains us to draw it on the screen and to print it on a paper sheet. Two approaches are possible :

All the found 2 of 5 interleaved barcodes on the net (Incomplete demonstration font) aren't free, several times expensive, and with uncertain quality; the width module isn't always permanent  in the font definition. I've decided consequently to draw entirely a 2 of 5 interleaved font and to propose it for download. I test it on a laser printer with size 15, what gives a small barcode with a width of about 1,2 mm/digit, result : reading at 100% ! On a good inkjet printer, we can use the same size 15 for the same result.

The font " code25I.ttf "

Since 2 of 5 interleaved barcodes encode pairs of digit my font contain the 100 pairs from 00 to 99. 2 additionnal characters are reserved for start and end symbol.

Pair of digits

ASCII Code

Character

Pattern

 00

 0033

 !

 NNNNWWWWNN

 01

 0034

 "

 NWNNWNWNNW

.../...

 93

 0126

 ~

 NWWWNNWNNN

 94

 0195

 A

 NNWNNWWNNW

.../...

 99

 0200

 E

 NNWNNNWWNW

 Start

 0201

 E

 NNNN

Stop

 0202

 E

 WNN

Copy this file
in the font directory,
often named :
C:\WINDOWS\FONTS

Structure of a 2 of 5 interleaved barcode

A 2 of 5 interleaved barcode will be build up in the following way :

A small test program.

Here is a small program
written with Visual Basic 6.
The setup file copy the
program, the Visual Basic
dependencies, the source
files and the font.

 

Setup file :

ZIP file without setup :

The Code25I$ function can be re-used in any other program written with Visual BASIC 6; it can also be copied just as it is in a VBA macro linked to an Excel or Word document.

Public Function Code25I$(chaine$, Optional key As Boolean)
  'V 2.0.0
  'Parametres : * une chaine
  '             * un drapeau vrai si une cle doit etre ajoutee
  'Parameters : * a string
  '             * a flag true if a key must be added
  'Retour : * une chaine qui, affichee avec la police CODE25I.TTF, donne le code barre
  '         * une chaine vide si parametre fourni incorrect
  'Return : * a string which give the bar code when it is dispayed with CODE25I.TTF font
  '         * an empty string if the supplied parameter is no good
  Dim i%, checksum&, dummy%
  Code25I$ = ""
  If Len(chaine$) > 0 Then
    'Verifier si caracteres valides
    'Check for valid characters
    For i% = 1 To Len(chaine$)
      If Asc(Mid$(chaine$, i%, 1)) < 48 Or Asc(Mid$(chaine$, i%, 1)) > 57 Then Exit Function
    Next
    'Ajouter si necessaire la cle
    'Add if necessary the checksum
    If key Then
      For i% = Len(chaine$) To 1 Step -2
        checksum& = checksum& + Val(Mid$(chaine$, i%, 1))
      Next
      checksum& = checksum& * 3
      For i% = Len(chaine$) - 1 To 1 Step -2
        checksum& = checksum& + Val(Mid$(chaine$, i%, 1))
      Next
      chaine$ = chaine$ & (10 - checksum& Mod 10) Mod 10
    End If
    'Verifier si la longueur est paire
    'Check if the length is odd
    If Len(chaine$) \ 2 <> Len(chaine$) / 2 Then Exit Function
    'Calculer la chaine de code
    'Calculation of the code string
    For i% = 1 To Len(chaine$) Step 2
      dummy% = Val(Mid$(chaine$, i%, 2))
      dummy% = IIf(dummy% < 94, dummy% + 33, dummy% + 101)
      Code25I$ = Code25I$ & Chr$(dummy%)
    Next
    'Ajoute START et STOP / Add START and STOP
    Code25I$ = Chr$(201) & Code25I$ & Chr$(202)
  End If
End Function

Sample file for Excel : and with Open Office :

Since the first publication of this page, I'd received a Delphi version :

Language

Author

Delphi

Francisco FERNANDEZ

Visual Foxpro

Cedric THIVIND

C#

Pauline


Do you like this page ?

Is it useful for you
?

Click here !