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 PDF417 code


Version francaise

This code is part of 2 dimentional code family, it's in fact a code with several rows which can encode up to 2700 bytes what explain its name of "Portable Document File". The encoding is done in two stages : first the datas are converted to "codeword" (High level encoding) then those are converted to bars and spaces patterns. (Low level encoding) Moreover an error correction system with several levels is included, it allows to reconstitute badly printed, erased, fuzzy or torn off datas. In the continuation of this talk, the word "codeword" will be shortened into CW.

The general structure.

 

 

 

 S

 t

 a

 r

 t

 

 

 L1

 D15

D14

 R1

 

 

 

 S

 t

 o

 p

 

 

 

 L2

 D13

 D12

 R2

 L3

 D11

 D10

 R3

 L4

 D9

 D8

 R4

 L5

 D7

 D6

 R5

 L6

 D5

 D4

 R6

 L7

 D3

 D2

 R7

 L8

 D1

 D0

 R8

 L9

 C3

 C2

 R9

L10

C1

C0

R10

Low level encoding.

High level encoding.

 Value 

 Uppercase 

 Lowercase 

 Mixed 

 Punctuation 

0

A

a

0

;

1

B

b

1

<

2

C

c

2

>

3

D

d

3

@

4

E

e

4

[

5

F

f

5

\

6

G

g

6

]

7

H

h

7

_

8

I

I

8

` (Quote)

9

J

j

9

~

10

K

k

&

!

11

L

l

CR

CR

12

M

m

HT

HT

13

N

n

,

,

14

O

o

:

:

15

P

p

#

LF

16

Q

q

-

-

17

R

r

.

.

18

S

s

$

$

19

T

t

/

/

20

U

u

+

g

21

V

v

%

|

22

W

w

*

*

23

X

x

=

(

24

Y

y

^

)

25

Z

z

PUN

?

26

SP

SP

SP

{

27

LOW

T_UPP

LOW

}

28

MIX

MIX

UPP

 ' (Apostrophe)

29

T_PUN

T_PUN

T_PUN

UPP

Errors detection and correction.

Level

Number of CWs required by the correction
system, 2 of which for the detection ( 2
level + 1)

Maximum number of data CWs

0

2

925

1

4

923

2

8

919

3

16

911

4

32

895

5

64

863

6

128

799

7

256

671

8

512

415

Number of data CWs

Advisable level

1 a 40

2

41 a 160

3

161 a 320

4

321 a 863

5

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 :

It seems that there's no free bar code PDF417 font on the net. I've decided consequently to draw this font and to propose it for download. Because there's 929 CWs with 3 alternatives for each one obligate us to divide the 17 bits of a CW in several parts. But divide by 17 ... hmmm ... a trick is necessary. If we considere that the first bit is always "1" and the last one "0", we can imagine a separator like "01" and the remain is only 15 bits in each CW; we can then divide these 15 bits into 3 parts. There will be then 25 = 32 possible groups affected to 32 characters of the font. The encoding software is in charge to transform the 3 groups of each CW into a 3 characters string.
The font will contain thus the following characters :

The string to send to the printer will look something like this : +*gfA*jhD*BAl*gCt*hjk*- and this for each row.

The "pdf417.ttf" font

This font contains the 35 patterns describe above. The start row and end row codes embed a 2 modules margin. The height is equal to 3 modules which is the most current size.

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

Encoding a pdf417 bar code

The software will evolve with 4 steps :

Because of the interaction between the different compaction modes and the different sub-modes of the "text" mode it's difficult to make a 100% optimization.  Thus the software will split the string into "parts" having the type "numeric", "text" or "byte" afterwards it will change some parts for an other mode if the overload due to switch CWs is greater than the compaction gain. We'll can't make allowance for all the parameters like paddings, gain due to perfect multiple of 6, uni-character switch or the switchs between the different sub-modes of the text mode : one would need for that several thousands of programming lines.
Another difficulty comes from the size of the wielded numbers, for example the "Modulo 900" operation applied on a 44 digits number generate an unavoidable overload error; the software will have to carry out this calculation step by step.

A small program to test all that


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 PDF417$ function have about 500 lines, I thus don't reproduce it here, you can retrieve it in the "form1.frm" file which is with the above program ; with setup program, the "form1.frm" file is in the program directory, "sources" sub-directory.
The function call is like this : result$ = pdf417$(String$, Security%, ColNb%, ErrCode%)
with the string to encode in String$, correction level in Security% (-1 = auto.), ColNb% for the number of data columns in a row (<1 = auto.) and ErrCode% for retrieving an eventual error code. these 3 last parameters are not required and are passed by references; after the function return they contains the really used values. Values of ErrCode% after the function return :

It is enough now to display or to print the chains result$ with the pdf417 font for example in a text processing. The Word users will be able to even integrate the pdf417$ function in a macro to automate the treatment. For carrying out all the treatments in a single function, I've been obliged to use "Gosub" instead of functions with parameters; I already listen programming aesthete to howl that it's a sacrilege.
 


Do you like this page ?


Is it useful for you
?

Click here !