Graphics - Advanced

For the most important Printer Control values, see: Printing bar codes using Printer Controls

Read the section below if you wish to print bar codes with a specific;

Bar codes contain bars and spaces. Bars are dark, spaces are light.

Each type of bar code (symbology) defines a set of possible widths for the bars and the spaces.

Some symbologies use 2 unique widths, others use 4 unique widths.

Two unique module widths

  • Code 39
  • Codabar
  • Interleaved 2-of-5 (ITF)
  • ITF-14
  • Industrial 2-of-5
  • Standard 2-of-5

Four unique module widths

  • UCC/EAN-128
  • EAN-8, EAN-13
  • UPC-E, UPC-A
  • Code 128
  • Code 93
  • SSCC-18

Example: Code 39 has only 2 unique module widths, so all of the bars and spaces are either narrow or wide. Here is an example of a Code 39 character;

S1=<Width>, S2=<Width>, S3=<Width>, S4=<Width>

Note: Values S1, S2, S3, S4 are in device units (pixels) of the printer. The values will be different for 300 dpi printers and 200 dpi printers.

S1, S2, S3, S4 specify the module widths of bars, for the type of bar code used. S1 is the width of the narrowest bar. S4 the widest bar.

L1=<Width>, L2=<Width>, L3=<Width>, L4=<Width>

Note: Values L1, L2, L3, L4 are in device units (pixels) of the printer. The values will be different for 300 dpi printers and 200 dpi printers.

L1, L2, L3, L4 specify the module widths of spaces, for the type of bar code used. L1 is the width of the narrowest space. L4 the widest space.

Code 39 requires only; S1, S2 and L1, L2 to be specified.

Code 128 requires; S1, S2, S3, S4 and L1, L2, L3, L4 to be specified.

Code 39 example

When an application requires bar codes, the specification will specify the symbology to be used (e.g. Code 39).

When the symbology has 2 unique module widths, a ratio is also specified (e.g. ratio 3:1).

Also the x dimension is specified - this is the actual width of the narrowest bar - it is specified in mm or mil (1/1000").

The x dimension is the actual width of the narrowest bar. This will affect S1 and L1 in the printer controls.

The ratio is the relative width between the narrowest and widest bars.

Usually the ratio for Code 39 is 3:1 which means wide bars are 3 times wider than the narrow bars. Other common ratios are 2.5:1 which means 2.5 times wider than the narrow bar.

Example: To print a Code 39 using x dimension of 15 mil, and ratio 3:1 on a special thermal label printer (200 dpi resolution).

x dimension = 15 mil = 15 * 1/1000".

Using 200 dpi printer, each pixel is 5/1000".

x dimension = 3 pixels

S1=3

ratio = 3:1

S1=3
S2=9

Normal syntax;

<ESC> is the ASCII character ESC, 27, hex 1B
<ESC>bC=39,P=1,S1=3,S2=9,L1=3,L2=9,D=

Alternate syntax;

<ESC>bC=39,P=1,S1=3:9,L1=3:9,D=

Alternate syntax;

<ESC>bC=39,P=1,S1=3:9,D=

Code 128 example

When an application requires bar codes, the specification will specify the symbology to be used (e.g. Code 128).

When Code 128 is used, usually an x dimension is specified - this is the actual width of the narrowest bar - it is specified in mm or mil (1/1000").

Example: To print a Code 128 using x dimension of 15 mil on a special thermal label printer (200 dpi resolution).

x dimension = 15 mil = 15 * 1/1000".

Using 200 dpi printer, each pixel is 5/1000".

x dimension = 3 pixels

S1=3

Code 128 has four module widths; 

(1 * x), (2 * x), (3 * x), (4 * x)

3, 9, 12, 15

Normal syntax;

<ESC>bC=128B,P=1,S1=3,S2=9,S2=12,S2=15,L1=3,L2=9,L3=12,L4=15,D=

Alternate syntax;

<ESC>bC=128B,P=1,S1=3:9:12:15,L1=3:9:12:15,D=

Alternate syntax;

<ESC>bC=128B,P=1,S1=3:9:12:15,D=

If no values are given for; L1, L2, L3, L4 then the values are copied from; S1, S2, S3, S4.

 

 

 


Copyright 2000 CIA (BAR CODES) UK. All rights reserved. Reproduction prohibited.