Dynamically Generating I25 Bar Codes, Part 2
By Daniel Goncalves
In Part 1 we looked at creating the I25Encode() function.
We now need to write our ASP code that will take the results of this function and display the correct bar
codes!
Creating An Apropriated Graphics Set
Now we must create a simple graphics (GIF) set. One for the narrow bar (black, 2 pixels wide), one for the
narrow space (white, 2 pixels wide), one for the wide bar (black, 4 pixels wide) and one for the wide space
(white 4 pixels wide), all these graphics can have 39 pixels height or more. I have included a
ZIP file
containing these graphics. The file names are:
| File Name | Description | Image |
|---|---|---|
nb.gif | Narrow bar | |
ns.gif | Narrow space | |
wb.gif | Wide bar | |
ws.gif | Wide space |
<IMG ...> tags.
Writing The Final Code
Now we'll write the final code. This code will read the string returned by I25Encode() function
and generate the resulting HTTP using our gifs. (While I don't show the I25Encode() function in
the script below, it must be included (either cut and pasted into the file or via a
server-side include.)
|
(If you are interested in seeing the results, go ahead and give the live demo a whirl!) Well done and Happy Programming!
Attachments:
I25Encode function in text format




