HPRT TP809 Owner's manual

TP809
Programming Manual
Rev.1.2

REVISION RECORDS
REV
DATE
DESCRIPTION
Drawn
Checked
Approved
1.0
2017/11/14
PUBLICATION
Yan Xiaomei
Lin Yang
Lin Yang
1.1
2018/11/28
Modify Function
065/066/067/068/069/080/081/
082/167/169/180/182
Baochun Lin
Lin Yang
Lin Yang
1.2
2018.12.03
Add function:
ESC &, ESC 3, ESC S, FS !, FS &,
FS –, FS ., FS 2, FS S , FS W, ESC i
ESC m, ESC u
Baochun Lin
Lin Yang
Lin Yang

About This Manual
Please read this technical manual before programming.
Main description for command as below:
1)Function
This is the first part of command description. Here we propose the command of ASCII code and its function.
2)Format
This part describes the command with ASCII code format, HEX., format, and Decimal format.
3)Range
The range of the variable
The range value is default as decimal digit. For example, 1 ≤ n ≤ 4, “1” and “4” are decimal digits.
4)Description
Detailed illustration for the command
5)Note
Different mode must be with different command. This part explains the interaction details in different mode.
6)Reference
Other commands which are interrelated or similar with this.

TABLE OF CONTENTS
About This Manual .......................................................................................................................... 1
1 Bit Image Commands .................................................................................................................... 1
Select bit-image mode.............................................................................................................................................. 1
Define downloaded bit image .................................................................................................................................. 1
Print downloaded bit image ..................................................................................................................................... 2
Set graphics data ...................................................................................................................................................... 2
GS ( L pL pH m fn [parameters]................................................................................................................................. 3
Transmit the NV graphics memory capacity ............................................................................................................. 4
<Function 50> GS ( L pL pH m fn (fn = 2, 50) ......................................................................................................... 4
<Function 51> GS ( L pL pH m fn (fn = 3, 51) ......................................................................................................... 4
<Function 64> GS ( L pL pH m fn d1 d2 (fn = 64) ................................................................................................... 5
<Function 65> GS ( L pL pH m fn d1 d2 d3 (fn = 65) .............................................................................................. 5
<Function 66> GS ( L pL pH m fn kc1 kc2 (fn = 66) ................................................................................................ 5
<Function 67> GS ( L pL pH m fn a kc1 kc2 b xL xH yL yH [c d1…dk]1…[c d1....dk]b (fn = 67).................................. 6
<Function 69> GS ( L pL pH m fn kc1 kc2 x y (fn = 69) ........................................................................................... 7
<Function 112> GS ( L pL pH m fn a bx by c xL xH yL yH d1...dk (fn = 112) ........................................................... 8
2 Print Position Commands .............................................................................................................. 9
HT ............................................................................................................................................................................. 9
ESC $ nL nH............................................................................................................................................................... 9
ESC T n ...................................................................................................................................................................... 9
GS $ nL nH .............................................................................................................................................................. 10
ESC \ nL nH ............................................................................................................................................................. 10
ESC W xL xH yL yH dxL dxH dyL dyH .................................................................................................................... 11
ESC a n .................................................................................................................................................................... 12
ESC D n1...nk NUL ................................................................................................................................................... 12
GS L nL nH............................................................................................................................................................... 12
GS W nL nH............................................................................................................................................................. 13
GS \ nL nH............................................................................................................................................................... 13
3 Print Commands ......................................................................................................................... 14
LF ............................................................................................................................................................................ 14
FF (In page mode)................................................................................................................................................ 14
ESC FF ..................................................................................................................................................................... 14
ESC J n..................................................................................................................................................................... 15
ESC d n.................................................................................................................................................................... 15
GS ( A pL pH n m ..................................................................................................................................................... 16
4 Miscellaneous Function Commands............................................................................................. 17
ESC @ ..................................................................................................................................................................... 17
ESC L ....................................................................................................................................................................... 17
ESC p m t1 t2 .......................................................................................................................................................... 17
5 Character Control Commands...................................................................................................... 18
ESC ! n..................................................................................................................................................................... 18

ESC % n ................................................................................................................................................................... 18
ESC ? n .................................................................................................................................................................... 19
ESC SP n .................................................................................................................................................................. 19
CAN......................................................................................................................................................................... 19
ESC – n .................................................................................................................................................................... 19
ESC E n .................................................................................................................................................................... 20
ESC R n.................................................................................................................................................................... 20
ESC M n................................................................................................................................................................... 21
ESC V n.................................................................................................................................................................... 21
ESC { n..................................................................................................................................................................... 21
ESC G n ................................................................................................................................................................... 22
GS B n ..................................................................................................................................................................... 22
GS ! n ...................................................................................................................................................................... 23
ESC t n..................................................................................................................................................................... 24
ESC & ...................................................................................................................................................................... 25
6 Status Commands ....................................................................................................................... 27
GS r n ...................................................................................................................................................................... 27
ESC v ....................................................................................................................................................................... 29
DLE EOT n ............................................................................................................................................................... 30
7 Barcode Commands .................................................................................................................... 33
GS h n ..................................................................................................................................................................... 33
GS f n ...................................................................................................................................................................... 33
GS H n ..................................................................................................................................................................... 33
GS k......................................................................................................................................................................... 34
GS w n..................................................................................................................................................................... 35
GS ( k pL pH cn fn [parameters].............................................................................................................................. 36
<Function 065> GS ( k pL pH cn fn n (cn = 48, fn = 65)........................................................................................ 37
<Function 066> GS ( k pL pH cn fn n (cn = 48, fn = 66)........................................................................................ 37
<Function 067> GS ( k pL pH cn fn n (cn = 48, fn = 67)........................................................................................ 37
<Function 068> GS ( k pL pH cn fn n (cn = 48, fn = 68)........................................................................................ 38
<Function 069> GS ( k pL pH cn fn n (cn = 48, fn = 69)........................................................................................ 38
<Function 080> GS ( k pL pH cn fn m d1…dk (cn = 48, fn = 80)........................................................................... 39
<Function 081> GS ( k pL pH cn fn m (cn = 48, fn = 81)....................................................................................... 40
<Function 082> GS ( k pL pH cn fn m (cn = 48, fn = 82)....................................................................................... 40
<Function 167> GS ( k pL pH cn fn n (cn = 49, fn = 67)........................................................................................ 41
<Function 169> GS ( k pL pH cn fn n (cn = 49, fn = 69)........................................................................................ 41
<Function 180> GS ( k pL pH cn fn m d1…dk (cn = 49, fn = 80)........................................................................... 42
<Function 181> GS ( k pL pH cn fn m (cn = 49, fn = 81)....................................................................................... 42
<Function 182> GS ( k pL pH cn fn m (cn = 49, fn = 82)....................................................................................... 43
8 Mechanical Control Commands ................................................................................................... 44
GS V ........................................................................................................................................................................ 44
ESC i ........................................................................................................................................................................ 44
ESC m...................................................................................................................................................................... 45
ESC u....................................................................................................................................................................... 46
9 Line Spacing Commands.............................................................................................................. 47

ESC 3....................................................................................................................................................................... 47
10. Miscellaneous Commands ........................................................................................................ 48
ESC S ....................................................................................................................................................................... 48
11.KANJI Commands...................................................................................................................... 49
FS !.......................................................................................................................................................................... 49
FS & ........................................................................................................................................................................ 50
FS - .......................................................................................................................................................................... 51
FS . .......................................................................................................................................................................... 52
FS 2 ......................................................................................................................................................................... 53
FS W........................................................................................................................................................................ 54
12. Other Commands..................................................................................................................... 55
FS q n [xL xH yL yH d1...dk]1...[xL xH yL yH d1...dk]n & FS p n m [obsolete command]............................. 55
GS v 0 m xL xH yL yH d1...dk [obsolete command]................................................................................................. 55
ESC 2....................................................................................................................................................................... 56

TP809 Programming Manual
1
1 Bit Image Commands
Select bit-image mode
[Format]
ASCII
ESC * m nL nH d1...dk
Hex
1B 2A m nL nH d1...dk
Decimal
27 42 m nL nH d1...dk
[Range]
m = 0, 1, 32, 33
1 ≤ (nL + nH × 256) ≤ 2047
(0 ≤ nL ≤ 255, 0 ≤ nH ≤ 7)
0 ≤ d ≤ 255
k = nL + nH × 256 [when m = 0, 1]
k = (nL + nH × 256) × 3 [when m = 32, 33]
[Description]
• Stores the bit image data in the print buffer using the bit image mode specified by m.
• nL, nH specifies the number of dots of the image data in the horizontal direction as (nL
+ nH × 256).
• d specifies the bit image data (column format).
m
Bit image mode
Vertical direction
Horizontal direction
0
8 dots single-density
68 dpi
101 dpi
1
8 dots dual-density
68 dpi
203 dpi
32
24-dot single-density
203 dpi
101 dpi
33
24-dot double-density
203 dpi
203 dpi
Define downloaded bit image
[Format]
ASCII
GS * x y d1...dk
Hex
1D 2A x y d1...dk
Decimal
29 42 x y d1...dk
[Range]
1 ≤ x ≤ 255
1 ≤ y ≤ 48 [where 1 ≤ x × y ≤ 1536]
0 ≤ d ≤ 255
k = x × y × 8
[Description]
• Defines the downloaded bit image in the downloaded graphic area.
• x specifies the number of bytes in the horizontal direction as x bytes.
• y specifies the number of bytes in the vertical direction as y bytes.
• d specifies the defined data (column format).
[Note]
•A downloaded bit image and user-defined characters(ESC &) cannot be defined
simultaneously.When this command is executed,all user-defined characters are deleted.

TP809 Programming Manual
2
Print downloaded bit image
[Format]
ASCII
GS / m
Hex
1D 2F m
Decimal
29 47 m
[Range]
0 ≤ m ≤ 3, 48 ≤ m ≤ 51
[Description]
Prints downloaded bit image defined by GS ∗ and using the mode specified by m.
m
Mode
Vertical direction
Horizontal direction
0, 48
Normal
203dpi
203dpi
1, 49
Double-width
203dpi
101dpi
2, 50
Double-height
101dpi
203dpi
3, 51i
Quadruple
101dpi
101dpi
Set graphics data
[Format]
ASCII
GS 8 L p1 p2 p3 p4 m fn [parameters]
Hex
1D 38 4C p1 p2 p3 p4 m fn [parameters]
Decimal
29 56 76 p1 p2 p3 p4 m fn [parameters]
• In the description below, only GS (L is used for explanation).
• Note that GS (L and GS 8 L have the same function).
• If the [parameters] in the Format column in the table below exceed 65533 bytes, use GS
8 L.
• The only differences between GS (L and GS 8 L are as listed below. The format for GS 8 L
is not provided in the following descriptions; however, [Range], [Default], [Description],
and [Notes] for parameters other than those listed in the table below are the same as for
GS ( L. <Parameters specifying the number of parameters after pH or p4>
Command
Parameters
Structure
Maximum value
GS ( L
pL, pH
2 bytes
65,535
GS 8 L
p1, p2, p3, p4
4 bytes
4,294,967,295
• Processes graphics data.
• pL, pH specify (pL + pH × 256) as the number of bytes after pH (m, fn, and
[parameters]).
• fn specifies the function.
• [parameters] specify the process of each function.

TP809 Programming Manual
3
GS ( L pL pH m fn [parameters]
[Format]
ASCII
GS ( L pL pH m fn [parameters]
Hex
1D 28 4C pL pH m fn [parameters]
Decimal
29 40 76 pL pH m fn [parameters]
[Note]
• Frequent write command executions by an NV memory write command may damage
the NV memory.
Therefore, it is recommended to limit writing the commands into the NV memory to less
than 10 times a day.
• If the power is turned off or the printer is reset via an interface while this command is
being executed, the printer may go into an abnormal condition. Be careful not to turn
the power off or let the printer be reset via an interface while this command is being
executed.
• While processing this command, the printer is BUSY while writing the data to the NV
memory and stops receiving data. Therefore, be sure not to transmit data, including the
real-time commands, while the printer is BUSY.
• When <Function 48, 51, or 64> is transmitted, do not transmit the subsequent data
until the status is received. ESC/POS Handshaking Protocol procedures are required
when using <Function 64>.
fn
Format
Function No.
Function name
0,48
GS ( L pL pH m fn
48
Transmit the NV graphics memory capacity
2,50
GS ( L pL pH m fn
50
Print the graphics data in the print buffer
3,51
GS ( L pL pH m fn
51
Transmit the remaining capacity of the
NV graphics memory
64
GS ( L pL pH m fn d1 d2
64
Transmit the key code list for defined
NV graphics
65
GS ( L pL pH m fn d1 d2 d3
65
Delete all NV graphics data
66
GS ( L pL pH m fn kc1 kc2
66
Delete the specified NV graphics data
67
GS ( L pL pH m fn a kc1 kc2 b xL
xH yL yH [c d1...dk]1... [c
d1...dk]b
67
Define the NV graphics data (raster
format)
69
GS ( L pL pH m fn kc1 kc2 x y
69
Print the specified NV graphics data
112
GS ( L pL pH m fn a bx by c xL
xH yL yH d1…dk
112
Store the graphics data in the print
buffer (raster format)

TP809 Programming Manual
4
Transmit the NV graphics memory capacity
[Format]
ASCII
GS ( L pL pH m fn
Hex
1D 28 4C pL pH m fn
Decimal
29 40 76 pL pH m fn
[Range]
(pL + pH × 256) = 2 (pL = 2, pH = 0)
m = 48
fn = 0, 48
[Description]
Transmit the entire capacity of the NV graphics area (number of bytes in the NV graphics
area).
<Function 50> GS ( L pL pH m fn (fn = 2, 50)
[Function]
Print the graphics data in the print buffer
[Format]
ASCII
GS ( L pL pH m fn
Hex
1D 28 4C pL pH m fn
Decimal
29 40 76 pL pH m fn
[Range]
(pL + pH × 256) = 2 (pL = 2, pH = 0)
m = 48
fn = 2, 50
[Description]
Prints the buffered graphics data stored by processing of GS ( L <Function 112>.
<Function 51> GS ( L pL pH m fn (fn = 3, 51)
[Function]
Transmit the remaining capacity of the NV graphics memory
[Format]
ASCII
GS ( L pL pH m fn
Hex
1D 28 4C pL pH m fn
Decimal
29 40 76 pL pH m fn
[Range]
(pL + pH × 256) = 2 (pL = 2, pH = 0)
m = 48
fn = 3, 51
[Description]
Transmit the number of bytes of remaining memory (unused area) in the NV graphics
area.

TP809 Programming Manual
5
<Function 64> GS ( L pL pH m fn d1 d2 (fn = 64)
[Function]
Transmit the key code list for defined NV graphics
[Format]
ASCII
GS ( L pL pH m fn d1 d2
Hex
1D 28 4C pL pH m fn d1 d2
Decimal
29 40 76 pL pH m fn d1 d2
[Range]
(pL + pH × 256) = 4 (pL = 4, pH = 0)
m = 48
fn = 64
d1 = 75
d2 = 67
[Description]
Transmit the key code list for defined NV graphics.
<Function 65> GS ( L pL pH m fn d1 d2 d3 (fn = 65)
[Function]
Delete all NV graphics data
[Format]
ASCII
GS ( L pL pH m fn d1 d2 d3
Hex
1D 28 4C 05 00 30 41 43 4C 52
Decimal
29 40 76 5 0 48 65 67 76 82
[Range]
(pL + pH × 256) = 5 (pL = 5, pH = 0)
m = 48
fn = 65
d1 = 67
d2 = 76
d3 = 82
[Description]
Delete all NV graphics data.
<Function 66> GS ( L pL pH m fn kc1 kc2 (fn = 66)
[Function]
Delete the specified NV graphics data
[Format]
ASCII
GS ( L pL pH m fn kc1 kc2
Hex
1D 28 4C 04 00 30 42 kc1 kc2
Decimal
29 40 76 4 0 48 66 kc1 kc2
[Range]
(pL + pH × 256) = 4 (pL = 4, pH = 0)
m = 48
fn = 66
32 ≤ kc1 ≤ 126
32 ≤ kc2 ≤ 126
[Description]
Delete the NV graphics data defined by the key codes (kc1 and kc2).

TP809 Programming Manual
6
<Function 67> GS ( L pL pH m fn a kc1 kc2 b xL xH yL yH [c d1…dk]1…[c
d1....dk]b (fn = 67)
[Function]
Define the NV graphics data (raster format)
[Format]
ASCII
GS ( L pL pH m fn a kc1 kc2 b xL xH yL yH [c d1...dk]1...[c d1...dk]b
Hex
1D 28 4C pL pH m fn a kc1 kc2 b xL xH yL yH [c d1...dk]1...[c d1...dk]b
Decimal
29 40 76 pL pH m fn a kc1 kc2 b xL xH yL yH [c d1...dk]1...[c d1...dk]b
[Range]
(pL, pH) for GS ( L: 12 ≤ (pL + pH × 256) ≤ 65535 (0 ≤ pL ≤ 255, 0 ≤ pH ≤ 255)
(p1, p2, p3, p4) for GS 8 L:
12 ≤ (p1 + p2 × 256 + p3 × 65536 + p4 × 16777216) ≤ 4294967295
(0 ≤ p1 ≤ 255, 0 ≤ p2 ≤ 255, 0 ≤ p3 ≤ 255, 0 ≤ p4 ≤ 255)
Common parameters for GS ( L and GS 8 L:
m = 48
fn = 67
a = 48
32 ≤ kc1 ≤ 126
32 ≤ kc2 ≤ 126
b = 1 [when single-color print control is selected]
1 ≤ (xL + xH × 256) ≤ 8192 (0 ≤ xL ≤ 255, 0 ≤ xH ≤ 32)
1 ≤ (yL + yH × 256) ≤ 2304 (0 ≤ yL ≤ 255, 0 ≤ yH ≤ 9)
c = 49 [when single-color print control is selected]
0 ≤ d ≤ 255
k = (int ((xL + xH × 256) + 7) / 8) × (yL + yH × 256)
The entire capacity size = 256 KB maximum.
[Description]
• Defines the NV graphics data (raster format) as a record specified by the key codes
(kc1, kc2) in the NV graphics area.
• b specifies the number of the color of the defined data.
• xL, xH specify the number of dots in the horizontal direction as (xL + xH × 256).
• yL, yH specify the number of dots in the vertical direction as (yL + yH × 256).
• c specifies the color of the defined data.
• d specifies the defined data (raster format).
[Notes]
• In cases where there is sufficient capacity is not available for storing NV graphics data
specified by (xL + xH × 256) and (yL + yH × 256), this function is ignored.
• The [data value (k) + control information data value (24 bytes)] area of the NV graphics
data domain is used when this function is executed.
• NV graphics and NV bit image (FS q) cannot be defined simultaneously. When this
function is executed, all NV bit images are deleted.
c
Defined data color (*)
49
Color 1
50
Color 2

TP809 Programming Manual
7
<Function 69> GS ( L pL pH m fn kc1 kc2 x y (fn = 69)
[Function]
Print the specified NV graphics data
[Format]
ASCII
GS ( L pL pH m fn kc1 kc2 x y
Hex
1D 28 4C pL pH m fn kc1 kc2 x y
Decimal
29 40 76 pL pH m fn kc1 kc2 x y
[Range]
(pL + pH × 256) = 6 (pL = 6, pH = 0)
m = 48
fn = 69
32 ≤ kc1 ≤ 126
32 ≤ kc2 ≤ 126
x = 1, 2
y = 1, 2
[Description]
• Prints the NV graphics data defined by the key codes (kc1 and kc2).
• The graphics data is enlarged by x and y in the horizontal and vertical directions.
x, y
Vertical direction
Horizontal direction
1
203 dpi
203 dpi
2
101 dpi
101 dpi

TP809 Programming Manual
8
<Function 112> GS ( L pL pH m fn a bx by c xL xH yL yH d1...dk (fn = 112)
[Function]
Store the graphics data in the print buffer (raster format)
[Format]
ASCII
GS ( L pL pH m fn a bx by c xL xH yL yH d1...dk
Hex
1D 28 4C pL pH m fn a bx by c xL xH yL yH d1...dk
Decimal
29 40 76 pL pH m fn a bx by c xL xH yL yH d1...dk
[Range]
(pL, pH) for GS ( L:
11 ≤ (pL + pH × 256) ≤ 65535 (0 ≤ pL ≤ 255, 0 ≤ pH ≤ 255)
(p1, p2, p3, p4) for GS 8 L:
11 ≤ (p1 + p2 × 256 + p3 × 65536 + p4 × 16777216) ≤ 4294967295
(0 ≤ p1 ≤ 255, 0 ≤ p2 ≤ 255, 0 ≤ p3 ≤ 255, 0 ≤ p4 ≤ 255)
Common parameters for GS ( L and GS 8 L:
m = 48
fn = 112
a = 48
bx = 1, 2; by = 1, 2
c = 49 [when single-color print control is selected]
1 ≤ (xL + xH × 256) ≤ 2047 (0 ≤ xL ≤ 255, 0 ≤ xH ≤ 7)
When single-color print control is selected
1 ≤ (yL + yH × 256) ≤ 1662 (0 ≤ yL ≤ 255, 0 ≤ yH ≤ 6) [when by=1]
1 ≤ (yL + yH × 256) ≤ 831 (0 ≤ yL ≤ 255, 0 ≤ yH ≤ 3) [when by=2]
When two-color print control is selected
1 ≤ (yL + yH × 256) ≤ 831 (0 ≤ yL ≤ 255, 0 ≤ yH ≤ 3) [when by=1]
1 ≤ (yL + yH × 256) ≤ 415 (0 ≤ yL ≤ 255, yH = 0,1) [when by=2]
0 ≤ d ≤ 255
k = (int ((xL + xH × 256) + 7) / 8) × (yL + yH × 256)
[Description]
• Stores the graphics data (raster format) in the print buffer.
• The graphics data is enlarged by bx and by in the horizontal and vertical directions.
• c specifies the color for the stored data.
• xL, xH specify the number of dots in the horizontal direction as (xL + xH × 256).
• yL, yH specify the number of dots in the vertical direction as (yL + yH × 256).
• d specifies the stored data (raster format).
bx, by
Vertical direction
Horizontal direction
1
203 dpi
203 dpi
2
101 dpi
101 dpi

TP809 Programming Manual
9
2 Print Position Commands
HT
[Function]
Horizontal Tabs
[Format]
ASCII
HT
Hex
09
Decimal
9
[Description]
Moves the print position to the next horizontal tab position.
ESC $ nL nH
[Function]
Set absolute print position
[Format]
ASCII
ESC $ nL nH
Hex
1B 24 nL nH
Decimal
27 36 nL nH
[Range]
0 ≤ (nL + nH × 256) ≤ 65535
(0 ≤ nL ≤ 255, 0 ≤ nH ≤ 255)
[Description]
Moves the print position to [(nL + nH × 256) × (horizontal or vertical motion unit)] from
the left edge of the print area.
ESC T n
[Function]
Select print direction in page mode
[Format]
ASCII
ESC T n
Hex
1B 54 n
Decimal
27 84 n
[Range]
0 ≤ n ≤ 3, 48 ≤ n ≤ 51
[Default]
n = 0
[Description]
In page mode, selects the print direction and starting position.
n
Print direction
Starting position
0, 48
Left to right
Upper left
1, 49
Bottom to top
Lower left
2, 50
Right to left L
Lower right
3, 51
Top to bottom
Upper right

TP809 Programming Manual
10
GS $ nL nH
[Function]
Set absolute vertical print position in page mode
[Format]
ASCII
GS $ nL nH
Hex
1D 24 nL nH
Decimal
29 36 nL nH
[Range]
0≤(nL + nH × 256)≤65535 (0≤nL≤255, 0≤nH≤255)
[Description]
In page mode, moves the vertical print position to [(nL + nH × 256) × (vertical or
horizontal motion unit)] from the starting position set with ESC T.
ESC \ nL nH
[Function]
Set horizontal relative print position
[Format]
ASCII
ESC \ nL nH
Hex
1B 5C nL nH
Decimal
27 92 nL nH
[Range]
-32768 ≤ (nL + nH × 256) ≤ 32767
[Description]
• Moves the print position to [(nL + nH × 256) × (horizontal or vertical motion unit)] from
the current position.
• A positive number specifies movement to the right, and a negative number specifies
movement to the left.

TP809 Programming Manual
11
ESC W xL xH yL yH dxL dxH dyL dyH
[Function]
Set print area in page mode
[Format]
ASCII
ESC W xL xH yL yH dxL dxH dyL dyH
Hex
1B 57 xL xH yL yH dxL dxH dyL dyH
Decimal
27 87 xL xH yL yH dxL dxH dyL dyH
[Range]
0 ≤ (xL + xH × 256) ≤ 65535; (0 ≤ xL ≤ 255, 0 ≤ xH ≤ 255)
0 ≤ (yL + yH × 256) ≤ 65535; (0 ≤ yL ≤ 255, 0 ≤ yH ≤ 255)
1 ≤ (dxL + dxH × 256) ≤ 65535; (0 ≤ dxL ≤ 255, 0 ≤ dxH ≤ 255)
1 ≤ (dyL + dyH × 256) ≤ 65535; (0 ≤ dyL ≤ 255, 0 ≤ dyH ≤ 255)
[Default]
(xL + xH × 256) = 0 (xL = 0, xH = 0)
(yL + yH × 256) = 0 (yL = 0, yH = 0)
(dxL + dxH × 256) = 576 (dxL = 0, dxH = 2)
[80 mm paper width model]
(dxL + dxH × 256) = 384 (dxL = 104, dxH = 4)
[58 mm paper width model]
(dyL + dyH × 256) = 1662 (dyL = 126, dyH = 6)
[Description]
• In page mode, sets the size and the logical origin of the print area.
• xL, xH specify the horizontal logical origin as [(xL + xH × 256) × (horizontal motion unit)]
from absolute origin.
• yL, yH specify the vertical logical origin as [(yL + yH × 256) × (vertical motion unit)] from
absolute origin.
• dxL, dxH specify the horizontal dimension of print area as [(dxL + dxH × 256) ×
(horizontal motion unit)].
• dyL, dyH specify the vertical dimension of print area as [(dyL + dyH × 256) × (vertical
motion unit)].
[Note]
When single-color print control is selected, the vertical dimension of the print area can
be set to 207.95 mm {3324/360"} maximum.

TP809 Programming Manual
12
ESC a n
[Function]
Select justification
[Format]
ASCII
ESC a n
Hex
1B 61 n
Decimal
27 97 n
[Range]
0 ≤ n ≤ 2, 48 ≤ n ≤ 50
[Default]
n = 0
[Description]
In standard mode, aligns all the data in one line to the selected layout.
n
Justification
0,48
Left justification
1, 49
Centering
2, 50
Right justification
ESC D n1...nk NUL
[Function]
Setting horizontal tab position
[Format]
ASCII
ESC D n1 ...nk NUL
Hex
1B 44 n1 ...nk 00
Decimal
27 68 n1 ...nk 0
[Range]
1 ≤ n1 ≤ n2 ≤ ... ≤ nk ≤ 255
0 ≤ k ≤ 32
[Default]
n = 8, 16, 24, 32, 40, ..., 232, 240, 248
[for Font A (12 × 24) in a standard character size width]
[Description]
• Sets horizontal tab positions.
• n specifies the number of digits from the setting position to the left edge of the print
area.
• k is used to indicate the number of bytes set for the horizontal tab position.
GS L nL nH
[Function]
Set left margin
[Format]
ASCII
GS L nL nH
Hex
1D 4C nL nH
Decimal
29 76 nL nH
[Range]
0 ≤ (nL + nH × 256) ≤ 65535 (0 ≤ nL ≤ 255, 0 ≤ nH ≤ 255)
[Default]
(nL + nH × 256) = 0 (nL = 0, nH = 0)
[Description]
In standard mode, sets the left margin to [(nL + nH × 256) × (horizontal motion unit)].

TP809 Programming Manual
13
GS W nL nH
[Function]
Set print area width
[Format]
ASCII
GS W nL nH
Hex
1D 57 nL nH
Decimal
29 87 nL nH
[Range]
0 ≤ (nL + nH × 256) ≤ 65535 (0 ≤ nL ≤ 255, 0 ≤ nH ≤ 255)
[Default]
(nL + nH × 256) = 576 (nL = 40, nH = 2) [80 mm paper width model]
(nL + nH × 256) = 406 (nL = 80, nH = 1) [58 mm paper width model]
[Description]
In standard mode, sets the print area width to [(nL + nH × 256) × (horizontal motion
unit)].
GS \ nL nH
[Function]
Set relative vertical print position in page mode
[Format]
ASCII
GS \ nL nH
Hex
1D 5C nL nH
Decimal
29 92 nL nH
[Range]
-32768 ≤ (nL + nH × 256) ≤ 32767
[Description]
• In page mode, moves the vertical print position to [(nL + nH × 256) × (vertical or
horizontal motion unit)] from the current position.
• A positive number specifies downward movement, and a negative number specifies
upward movement.

TP809 Programming Manual
14
3 Print Commands
LF
[Function]
Print and line feed
[Format]
ASCII
LF
Hex
0A
Decimal
10
[Description]
Prints the data in the print buffer and feeds one line, based on the current line spacing.
FF (In page mode)
[Function]
Print and return to standard mode (in page mode)
[Format]
ASCII
FF
Hex
0C
Decimal
12
[Description]
Prints all the data in the print buffer collectively and switches from page mode to
standard mode.
ESC FF
[Function]
Print data in page mode
[Format]
ASCII
ESC FF
Hex
1B 0C
Decimal
27 12
[Description]
In page mode, prints all the data in the print buffer collectively.
Other manuals for TP809
4
Table of contents
Other HPRT Printer manuals