INFO: Use left margin command to keep 2D barcode aligned

Summary

When printing 2D barcodes using a PCL font, you need to keep all lines started from the same X position. There are several cursor movement commands, however note that the carriage return will move the cursor back to the leftmost of the paper. There are several solutions.

Left Margin Command

The PCL "Left Margin Command" is considered the best solution. With this command, you set all remaining printing to begin at X location. After the barcode is printed, you can reset the left margin to 0.

In the example below, <esc>&a10L sets left margin to the width of 10 text characters. Command <esc>9 resets the left margin back after the barcode is printed.

<esc>&a10L
<esc>& (8U<esc>& (s1p8v4699T 
<esc>&&l5.28C 
F3B6C3B29183B194B7D5
F4DDBE3C374B3EC75CA5  printing barcode
FF0898B19F91B6D189B5
F080361C5792AE1D9095
F19737195DB95DF7BD35
<esc>9

Cursor Movement Command

You can also call cursor movement commands to move the cursor. However, because carriage return resets the cursor position to the left margin, you must call movement command for every line of text.

In the example below, <esc>&a720H moves the cursor 1 inch right to the left margin (720 decimal points).

<esc>&a720HF3B6C3B29183B194B7D5
<esc>&a720HF4DDBE3C374B3EC75CA5
<esc>&a720HFF0898B19F91B6D189B5
<esc>&a720HF080361C5792AE1D9095
<esc>&a720HF19737195DB95DF7BD35