ZPLToolkit

^B9

UPC-E Bar CodePreview: partial

The compressed six-digit UPC, for retail packages too small to carry a full UPC-A.

Syntax

^B9o,h,f,g,e

Parameters

ParameterDescription and accepted valuesIf omitted
oRotation of the bar code on the label.N normal, R 90°, I 180°, B 270°Last ^FW value, else N
hBar height in dots. Overrides the height set by ^BY for this field only.1 to 32000 dotsHeight set by ^BY
fPrints the digits underneath the bars as text.Y or N — print the human-readable lineY
gMoves that text above the bars instead.Y or N — put that line above the barsN
ePrints the check digit as part of that text.Y or N — print the check digitY

How it works

^B9 prints UPC-E, a UPC-A with its zeroes squeezed out. A manufacturer whose code and product number contain the right pattern of zeroes can have the twelve digits compressed to six, which fits on a pack of gum where UPC-A would not.

The compression is not free-form: only certain UPC-A codes have a UPC-E equivalent, and the mapping is fixed by the GS1 specification. A scanner expands the six digits back to the full twelve before the point of sale sees them.

Send the code as seven or eight digits — the six data digits with the number system and check digit. The printer will not invent a valid UPC-E out of an arbitrary number.

Example

ZPL
^XA
^BY2,3,80
^FO60,60^B9N,80,Y,N,Y^FD1234565^FS
^XZ

Rendering…

A seven-digit UPC-E at a module width of 2 dots.
Open in the viewer

How the preview on this site handles it

Drawn with a real UPC-E encoder, so it scans, and rotation is applied. One thing the preview does not reproduce: the guard bars that extend below the rest of the symbol on a retail UPC, and the digits that sit beside them. Every bar is drawn to the same height.

Common mistakes

  • Passing a number that has no UPC-E form. Not every UPC-A compresses, and the field will not encode.
  • Shrinking it below the GS1 minimum. UPC-E has a defined magnification range; printing it smaller is what makes a retail scanner refuse the pack.
  • Losing the quiet zone. UPC needs clear space either side, and a field origin too close to the label edge is the usual cause of a no-read.

See also