Control Codes

This section provides examples of commands that can be used to create bar codes.

PCL Escape Sequences

The escape sequence controls the character strings (Hexa: 1B or Dec: 27) that begin with <Esc>. By embedding and sending these character strings to this Bar Code Printing function in an unprintable, special character code, you can control details, such as the bar code size, as well as the caption text font and the space between the characters.
The following is an example of a valid PCL escape sequence:
Readable text that is located under the bars, without start or stop characters (*)
Caption text in Univers Regular
Bar height:
40 points
40/72 = 0.555"
40*2.54/72 = 1.41 cm
Thin bars that are 10 dots wide, and thick bars that are 30 dots wide
Thin spaces that are 10 dots wide, and thick spaces that are 30 dots wide
Symbol: code 39

Bar Code Rotation Codes

To rotate a bar code, you can use regular PCL rotation commands. We recommend that you save the cursor position before activating the bar code, and restore the original cursor position after the bar code is rotated.
Example: (Sequences should be entered without carriage returns.)
Saves the cursor position.
Positions the cursor.
Rotates the bar code 90°.
Formats the bar code.
The bar code text data.
Switches back to Courier 10 cpi font.
Stops the rotation.
Restores the original cursor position.

Font Switching

You can switch primary and secondary fonts with bar code fonts. We recommend that a text font be used as the primary font, and a bar code font be used as the secondary font.
Bar codes are not PCL fonts, even if they are generated using a PCL font sequence. Therefore, the following font sequence limitations apply:
No font ID can be linked to a bar code
Bar codes cannot be used with HP-GL2, PostScript, or PCL XL languages

OCR-A and OCR-B Fonts

The following PCL escape sequences enable OCR-A and OCR-B fonts:
The above table shows the OCR-A character set.

FreeScape Codes

PCL codes always begin with the unprintable escape code Hexa: 1B or Dec: 27. Some systems cannot use or send binary data to a device, which can represent a problem when using the PCL language with bar codes. An example of this kind of system is a mainframe computer with printers connected to terminals. To avoid conflicts between the PCL language and bar codes in such a system, the FreeScape Code, a user-defined Escape Code or AEC (Alternate Escape Code) can be specified.
FreeScape acts exactly like the standard escape code when it is located at the beginning of a regular PCL font sequence. The default value for the AEC is a '~' (tilde). FreeScape ignores the AEC if it is determined to be pure data. You can also mix escape codes and alternate escape codes.
The AEC can be any one of the following 10 characters:
", #, $, /, \, ?, {, }, |, ~.
The PCL font sequence to change to the alternate escape code is as follows:
<Esc or AEC>**#J
# represents the ASCII decimal value of the new AEC or ESC. Values for AEC are 34 ("), 35 (#), 36 ($), 47 (/), 92 (\), 63 (?), 123 ({), 125 (}), 124 (|), or 126 (~). The value for ESC is 27. If you indicate 27, it disables the FreeScape Code.
The FreeScape escape sequence setting is only valid for the current job.
The FreeScape Code can be enabled, disabled, or set as a parameter for all jobs from the FreeScape menu in Printer Settings (from the Settings/Registration screen).
When FreeScape is disabled, only the escape code (Hexa: 1B or Dec: 27) can be used to start PCL commands.