|
This code allows only the coding of digits. They are coded 2 by 2 so the number of digits must be even.
Value | Encoding |
0 | NNWWN |
1 | WNNNW |
2 | NWNNW |
3 | WWNNN |
4 | NNWNW |
5 | WNWNN |
6 | NWWNN |
7 | NNNWW |
8 | WNNWN |
9 | NWNWN |
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.)
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.
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 |
A 2 of 5 interleaved barcode will be build up in the following way :
|
Here is a small program
|
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) |
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 ? Click here ! |