Print in Page mode


Print Sample

Graphic
 shows the paper cut position.
Graphic

Programming Example

'// ============================================================================
'//  Print in Page mode
'// ============================================================================

'// Initialize printer
    ESC "@"

'// Select Page mode
    ESC "L"
'// Set horizontal and vertical motion units: Horizontal motion unit = 0.125 mm
'// (1/203 inch), vertical motion unit = 0.125 mm (1/203 inch)
'// The above are values based on the dot density of the TM-T20 printing head,
'// and this script must be changed for each model.
    GS "P" 203 203


'// --- Store edge data --->>>
'// Set print area in Page mode: Horizontal logical origin = 6, vertical logical
'// origin = 0, horizontal dimension = 500, vertical dimension = 750
'// ESC  W  xL xH yL yH dxL dxH dyL dyH
    ESC "W"  6  0  0  0 244   1 238   2

'// [Concept of the above area size]
'//   (Premise) Use ESC * to print the sheet bordering by repeating 10 times on
'//      the short side and 15 times on the long side with the 25 dot (25 byte)
'//      column data as the unit pattern.
'//   1) If using ESC * with an 8-dot single-density, the dot density for each
'//      printing direction will be 203/2 [dpi] for both the short side (left-
'//      to-right printing) and long side (up-to-down printing) due to the ESC
'//      * command specifications in the TM-T20.
'//   2) Because the head of this script defines the horizontal and vertical
'//      motion units as 203 using GS P, due to 1), the size of 1 dot =
'//      horizontal and vertical motion units x 2 (for both short and long
'//      sides).
'//      Therefore, the size necessary to store the sheet bordering data is, in
'//      the horizontal and vertical motion units,
'//      short side: 25 dots*10 times*2 = 500, long side: 25 dots*15 times*2 = 750
'//  (Refer to the detailed specifications for the ESC W, ESC * , GS P commands.)

'// Select print direction in Page mode:
'// Starting position = upper left, print direction = left to right
    ESC "T" 0
'// Select bit-image mode: Write the column data for 8-dot single-density, 25
'// byte (border design pattern minimum unit)
'// Repeat this 10 times to construct a short side border pattern (coupon right
'// side)
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80

'// Select print direction in Page mode:
'// Starting position = lower left, print direction = bottom to top
    ESC "T" 1
'// Select bit-image mode: Same as above
'// Repeat 15 times in the same way to construct a long side border pattern (coupon
'// upper side)
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80


'// Select print direction in Page mode:
'// Starting position = lower right, print direction = right to left
    ESC "T" 2
'// Select bit-image mode: Same as above
'// Construct 1 more short side border pattern (coupon left side)
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80

'// Select print direction in Page mode:
'// Starting position = upper right, print direction = top to bottom
    ESC "T" 3
'// Select bit-image mode: Same as above
'// Construct 1 more long side border pattern (coupon lower side)
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
'// --- Store the border data ---<<<


'// --- Store message data --->>>
'// Set print area in Page mode: Horizontal logical origin = 140, vertical logical
'// origin = 118, horizontal dimension = 360, vertical dimension = 528
'// ESC  W   xL xH  yL yH dxL dxH dyL dyH
    ESC "W" 140  0 118  0 104   1  16   2
'// Select print direction in Page mode:
'// Starting position = lower left, print direction = bottom to top
    ESC "T" 1

'// Select character size: (horizontal (times 2) x vertical (times 2))
    GS "!" 0x11
'// Print and line feed and print character string
    LF " Merry Christmas !!" LF LF

'// Select character size: (horizontal (times 2) x vertical (times 1))
    GS "!" 0x10
    "   10% OFF COUPON"

'// Print and feed paper: paper feeding amount = 25.0 mm (200/203 inches)
    ESC "J" 200

    "EPSON DEPARTMENT STORE"
'// --- Store message data ---<<<


'// --- Store symbol A data --->>>
'// Print settings for the symbol on the top left of the coupon (Christmas tree)

'// Set print area in Page mode: Horizontal logical origin = 50, vertical logical
'// origin = 588, horizontal dimension = 72, vertical dimension = 68
'// ESC  W  xL xH yL yH dxL dxH dyL dyH
    ESC "W" 50  0 76  2  72   0  68   0

'// [Concept of the above area size]
'//   1) The symbol to be printed is a 24 dot tall, 34 dot wide graphic.
'//      This was constructed by using ESC * to stack 3 layers of 34 dot (34 byte)
'//      column data, and is printed.
'//   2) The printing direction is assumed to be "down to up", the graphic's
'//      "side" is the direction that corresponds to the dy parameter in ESC W
'//      (paper feeding direction).
'//   3) If using ESC * with 8-dot single-density, considering the print direction
'//      in 2) is "down to up", the dot density for the "side" of the graphic is
'//      the dot density of "vertical" in ESC *, in other words, 203/2 [dpi].
'//   4) Because the head of this script defines the horizontal and vertical
'//      motion units as 203 using GS P, the width of the "side" of 1 dot in the
'//      graphic corresponds to the horizontal and vertical motion units*2.
'//      Therefore, the necessary dy size to store 34 dots is 34*2=68.
'//      (dyL=68, dyH=0)
'//   5) In the same way, the height of 1 graphic dot = horizontal and vertical
'//      motion units*3.
'//      Therefore, the necessary dx size to store 24 dots is 24*3=72.
'//  (Refer to the detailed specifications for the ESC W, ESC *, GS P commands.)

'// Select print direction in Page mode:
'// Starting position = lower left, print direction = bottom to top
    ESC "T" 1
'// Set line spacing: Line spacing for 8 dots (so that there is not excess space
'// between lines)
    ESC "3" 24

'// Select bit-image mode: 8-dot single-density, 34 byte column data
'// Construct 1 graphic symbol with 3 lines
'// Be aware that it is column data that lines up in the y direction of ESC W
'// because of ESC T settings.
    ESC "*" 0 34 0
      0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x01 0x03 0x05 0x29 0x28 0x38 0x30
      0x20 0xE0 0x20 0x31 0x38 0x28 0x29 0x05 0x03 0x01 0x01 0x00 0x00 0x00 0x00
      0x00 0x00 0x00 0x00
    ESC "*"  0 34  0
      0x00 0x00 0x00 0x00 0x00 0x08 0x18 0x19 0x2A 0x4C 0x8C 0x80 0x02 0x47 0xE2
      0x40 0x00 0x80 0xC4 0x8E 0x04 0x80 0x8C 0x4C 0x2A 0x19 0x18 0x08 0x00 0x00
      0x00 0x00 0x00 0x00
    ESC "*"  0 34  0
      0x00 0x00 0x00 0x40 0x40 0xC0 0xC0 0x40 0x5C 0x54 0x57 0x55 0x55 0x75 0x75
      0x55 0x55 0x55 0x75 0x75 0x55 0x55 0x57 0x54 0x5C 0x40 0xC0 0xC0 0x40 0x40
      0x40 0x00 0x00 0x00
'// --- Store symbol A data ---<<<


'// --- Store symbol B data --->>>
'// Print settings for the symbol on the bottom right of the coupon
'// (Christmas cake)

'// Set print area in Page mode: Horizontal logical origin = 314, vertical logical
'// origin = 102, horizontal dimension = 72, vertical dimension = 96
'//    ESC  W  xL xH  yL yH dxL dxH dyL dyH
    ESC "W" 58  1 102  0  72   0  96   0
'// Select print direction in Page mode:
'// Starting position = lower left, print direction = bottom to top
    ESC "T" 1

'// Select bit-image mode: 8-dot single-density, 48 byte column data
    ESC "*" 0 48 0
      0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x07 0x07 0x09 0x09 0x7D 0x7C 0x10
      0x10 0x16 0x16 0x10 0x70 0xF8 0xFC 0x7E 0x3E 0x3E 0x7E 0xFE 0xFC 0x70 0x10
      0x16 0x16 0x10 0x10 0x7C 0x7D 0x09 0x09 0x07 0x07 0x00 0x00 0x00 0x00 0x00
      0x00 0x00 0x00
    ESC "*" 0 48  0
      0x1F 0x1F 0x24 0x21 0x40 0x42 0x42 0x41 0xF1 0xF1 0x29 0x59 0x59 0x8C 0x8C
      0xD4 0xD4 0xA4 0xA4 0xD4 0xD4 0x8C 0x8C 0xD4 0xD4 0xAC 0xAC 0xC4 0xC4 0xAC
      0xAC 0x94 0x94 0xAC 0xAC 0x49 0x49 0x29 0xF1 0xF1 0x41 0x42 0x42 0x40 0x23
      0x24 0x1F 0x1F
    ESC "*" 0 48  0
      0xF0 0xF0 0x4C 0x4C 0x24 0x24 0x24 0x12 0x12 0x12 0x12 0x12 0x12 0x89 0xA9
      0xA9 0x89 0x89 0x99 0x99 0x89 0x80 0x89 0xC9 0xC9 0x89 0x99 0x99 0x89 0xC9
      0xC9 0x89 0xA9 0xA9 0x89 0x12 0x12 0x12 0x12 0x12 0x12 0x24 0x24 0x24 0x4C
      0x4C 0xF0 0xF0
'// --- Store symbol B data ---<<<


'// --- Store the barcode --->>>
'// Set print area in Page mode: Horizontal logical origin = 276, vertical logical
'// origin = 226, horizontal dimension = 70, vertical dimension = 312
'//    ESC  W  xL xH  yL yH dxL dxH dyL dyH
    ESC "W" 20  1 226  0  70   0  56   1
'// Select print direction in Page mode:
'// Starting position = lower left, print direction = bottom to top
    ESC "T" 1
'// Select print position of HRI characters: Print position, below the barcode
    GS "H" 2
'// Select font for HRI characters: Font B
    GS "f" 1
'// Set barcode height: in case TM-T20, 5.00 mm (40/203 inches)
    GS "h" 40
'// Set barcode width: Module width = 2 (in case TM-T20, 0.250 mm)
    GS "w" 2
'// Set absolute vertical print position in Page mode: 5.00 mm (40/203 inches)
    GS "$" 40 0
'// Print barcode: (A) format, barcode system = CODE39
    GS "k" 4 "*10% OFF*" 0
'// --- Store the barcode ---<<<


'// Print data in Page mode: Batch print
    ESC FF
'// Select cut mode and cut paper: [Function B] Feed paper to (cutting position
'// + 10 mm (80/203 inches)) and executes a partial cut (one point left uncut).
    GS "V" 66 80
'// Select Standard mode (return to Standard mode)
    ESC "S"
'// ============================================================================
'//  Print in Page mode
'// ============================================================================

'// Initialize printer
    ESC "@"

'// Select Page mode
    ESC "L"
'// Set horizontal and vertical motion units: Horizontal motion unit = 0.125 mm
'// (1/203 inch), vertical motion unit = 0.125 mm (1/203 inch)
'// The above are values based on the dot density of the TM-T20 printing head,
'// and this script must be changed for each model.
    GS "P" 203 203


'// --- Store edge data --->>>
'// Set print area in Page mode: Horizontal logical origin = 6, vertical logical
'// origin = 0, horizontal dimension = 500, vertical dimension = 750
'// ESC  W  xL xH yL yH dxL dxH dyL dyH
    ESC "W"  6  0  0  0 244   1 238   2

'// [Concept of the above area size]
'//   (Premise) Use ESC * to print the sheet bordering by repeating 10 times on
'//      the short side and 15 times on the long side with the 25 dot (25 byte)
'//      column data as the unit pattern.
'//   1) If using ESC * with an 8-dot single-density, the dot density for each
'//      printing direction will be 203/2 [dpi] for both the short side (left-
'//      to-right printing) and long side (up-to-down printing) due to the ESC
'//      * command specifications in the TM-T20.
'//   2) Because the head of this script defines the horizontal and vertical
'//      motion units as 203 using GS P, due to 1), the size of 1 dot =
'//      horizontal and vertical motion units x 2 (for both short and long
'//      sides).
'//      Therefore, the size necessary to store the sheet bordering data is, in
'//      the horizontal and vertical motion units,
'//      short side: 25 dots*10 times*2 = 500, long side: 25 dots*15 times*2 = 750
'//  (Refer to the detailed specifications for the ESC W, ESC * , GS P commands.)

'// Select print direction in Page mode:
'// Starting position = upper left, print direction = left to right
    ESC "T" 0
'// Select bit-image mode: Write the column data for 8-dot single-density, 25
'// byte (border design pattern minimum unit)
'// Repeat this 10 times to construct a short side border pattern (coupon right
'// side)
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80

'// Select print direction in Page mode:
'// Starting position = lower left, print direction = bottom to top
    ESC "T" 1
'// Select bit-image mode: Same as above
'// Repeat 15 times in the same way to construct a long side border pattern (coupon
'// upper side)
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80


'// Select print direction in Page mode:
'// Starting position = lower right, print direction = right to left
    ESC "T" 2
'// Select bit-image mode: Same as above
'// Construct 1 more short side border pattern (coupon left side)
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80

'// Select print direction in Page mode:
'// Starting position = upper right, print direction = top to bottom
    ESC "T" 3
'// Select bit-image mode: Same as above
'// Construct 1 more long side border pattern (coupon lower side)
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
    ESC "*" 0 25 0
      0x80 0x80 0x80 0x60 0x80 0x80 0x80 0x8C 0xA5 0x51 0x4E 0x20 0x1A 0x20 0x4E
      0x51 0xA5 0x8C 0x80 0x80 0x80 0x60 0x80 0x80 0x80
'// --- Store the border data ---<<<


'// --- Store message data --->>>
'// Set print area in Page mode: Horizontal logical origin = 140, vertical logical
'// origin = 118, horizontal dimension = 360, vertical dimension = 528
'// ESC  W   xL xH  yL yH dxL dxH dyL dyH
    ESC "W" 140  0 118  0 104   1  16   2
'// Select print direction in Page mode:
'// Starting position = lower left, print direction = bottom to top
    ESC "T" 1

'// Select character size: (horizontal (times 2) x vertical (times 2))
    GS "!" 0x11
'// Print and line feed and print character string
    LF " Merry Christmas !!" LF LF

'// Select character size: (horizontal (times 2) x vertical (times 1))
    GS "!" 0x10
    "   10% OFF COUPON"

'// Print and feed paper: paper feeding amount = 25.0 mm (200/203 inches)
    ESC "J" 200

    "EPSON DEPARTMENT STORE"
'// --- Store message data ---<<<


'// --- Store symbol A data --->>>
'// Print settings for the symbol on the top left of the coupon (Christmas tree)

'// Set print area in Page mode: Horizontal logical origin = 50, vertical logical
'// origin = 588, horizontal dimension = 72, vertical dimension = 68
'// ESC  W  xL xH yL yH dxL dxH dyL dyH
    ESC "W" 50  0 76  2  72   0  68   0

'// [Concept of the above area size]
'//   1) The symbol to be printed is a 24 dot tall, 34 dot wide graphic.
'//      This was constructed by using ESC * to stack 3 layers of 34 dot (34 byte)
'//      column data, and is printed.
'//   2) The printing direction is assumed to be "down to up", the graphic's
'//      "side" is the direction that corresponds to the dy parameter in ESC W
'//      (paper feeding direction).
'//   3) If using ESC * with 8-dot single-density, considering the print direction
'//      in 2) is "down to up", the dot density for the "side" of the graphic is
'//      the dot density of "vertical" in ESC *, in other words, 203/2 [dpi].
'//   4) Because the head of this script defines the horizontal and vertical
'//      motion units as 203 using GS P, the width of the "side" of 1 dot in the
'//      graphic corresponds to the horizontal and vertical motion units*2.
'//      Therefore, the necessary dy size to store 34 dots is 34*2=68.
'//      (dyL=68, dyH=0)
'//   5) In the same way, the height of 1 graphic dot = horizontal and vertical
'//      motion units*3.
'//      Therefore, the necessary dx size to store 24 dots is 24*3=72.
'//  (Refer to the detailed specifications for the ESC W, ESC *, GS P commands.)

'// Select print direction in Page mode:
'// Starting position = lower left, print direction = bottom to top
    ESC "T" 1
'// Set line spacing: Line spacing for 8 dots (so that there is not excess space
'// between lines)
    ESC "3" 24

'// Select bit-image mode: 8-dot single-density, 34 byte column data
'// Construct 1 graphic symbol with 3 lines
'// Be aware that it is column data that lines up in the y direction of ESC W
'// because of ESC T settings.
    ESC "*" 0 34 0
      0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 0x01 0x03 0x05 0x29 0x28 0x38 0x30
      0x20 0xE0 0x20 0x31 0x38 0x28 0x29 0x05 0x03 0x01 0x01 0x00 0x00 0x00 0x00
      0x00 0x00 0x00 0x00
    ESC "*"  0 34  0
      0x00 0x00 0x00 0x00 0x00 0x08 0x18 0x19 0x2A 0x4C 0x8C 0x80 0x02 0x47 0xE2
      0x40 0x00 0x80 0xC4 0x8E 0x04 0x80 0x8C 0x4C 0x2A 0x19 0x18 0x08 0x00 0x00
      0x00 0x00 0x00 0x00
    ESC "*"  0 34  0
      0x00 0x00 0x00 0x40 0x40 0xC0 0xC0 0x40 0x5C 0x54 0x57 0x55 0x55 0x75 0x75
      0x55 0x55 0x55 0x75 0x75 0x55 0x55 0x57 0x54 0x5C 0x40 0xC0 0xC0 0x40 0x40
      0x40 0x00 0x00 0x00
'// --- Store symbol A data ---<<<


'// --- Store symbol B data --->>>
'// Print settings for the symbol on the bottom right of the coupon
'// (Christmas cake)

'// Set print area in Page mode: Horizontal logical origin = 314, vertical logical
'// origin = 102, horizontal dimension = 72, vertical dimension = 96
'//    ESC  W  xL xH  yL yH dxL dxH dyL dyH
    ESC "W" 58  1 102  0  72   0  96   0
'// Select print direction in Page mode:
'// Starting position = lower left, print direction = bottom to top
    ESC "T" 1

'// Select bit-image mode: 8-dot single-density, 48 byte column data
    ESC "*" 0 48 0
      0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x07 0x07 0x09 0x09 0x7D 0x7C 0x10
      0x10 0x16 0x16 0x10 0x70 0xF8 0xFC 0x7E 0x3E 0x3E 0x7E 0xFE 0xFC 0x70 0x10
      0x16 0x16 0x10 0x10 0x7C 0x7D 0x09 0x09 0x07 0x07 0x00 0x00 0x00 0x00 0x00
      0x00 0x00 0x00
    ESC "*" 0 48  0
      0x1F 0x1F 0x24 0x21 0x40 0x42 0x42 0x41 0xF1 0xF1 0x29 0x59 0x59 0x8C 0x8C
      0xD4 0xD4 0xA4 0xA4 0xD4 0xD4 0x8C 0x8C 0xD4 0xD4 0xAC 0xAC 0xC4 0xC4 0xAC
      0xAC 0x94 0x94 0xAC 0xAC 0x49 0x49 0x29 0xF1 0xF1 0x41 0x42 0x42 0x40 0x23
      0x24 0x1F 0x1F
    ESC "*" 0 48  0
      0xF0 0xF0 0x4C 0x4C 0x24 0x24 0x24 0x12 0x12 0x12 0x12 0x12 0x12 0x89 0xA9
      0xA9 0x89 0x89 0x99 0x99 0x89 0x80 0x89 0xC9 0xC9 0x89 0x99 0x99 0x89 0xC9
      0xC9 0x89 0xA9 0xA9 0x89 0x12 0x12 0x12 0x12 0x12 0x12 0x24 0x24 0x24 0x4C
      0x4C 0xF0 0xF0
'// --- Store symbol B data ---<<<


'// --- Store the barcode --->>>
'// Set print area in Page mode: Horizontal logical origin = 276, vertical logical
'// origin = 226, horizontal dimension = 70, vertical dimension = 312
'//    ESC  W  xL xH  yL yH dxL dxH dyL dyH
    ESC "W" 20  1 226  0  70   0  56   1
'// Select print direction in Page mode:
'// Starting position = lower left, print direction = bottom to top
    ESC "T" 1
'// Select print position of HRI characters: Print position, below the barcode
    GS "H" 2
'// Select font for HRI characters: Font B
    GS "f" 1
'// Set barcode height: in case TM-T20, 5.00 mm (40/203 inches)
    GS "h" 40
'// Set barcode width: Module width = 2 (in case TM-T20, 0.250 mm)
    GS "w" 2
'// Set absolute vertical print position in Page mode: 5.00 mm (40/203 inches)
    GS "$" 40 0
'// Print barcode: (A) format, barcode system = CODE39
    GS "k" 4 "*10% OFF*" 0
'// --- Store the barcode ---<<<


'// Print data in Page mode: Batch print
    ESC FF
'// Select cut mode and cut paper: [Function B] Feed paper to (cutting position
'// + 10 mm (80/203 inches)) and executes a partial cut (one point left uncut).
    GS "V" 66 80
'// Select Standard mode (return to Standard mode)
    ESC "S"

 

Quick Access

  • [Name]
  • [Format]
  • [Range]
  • [Description]
  • [Notes]

ESC/POS® includes patented or patent pending commands. The contents must not be disclosed to third parties.


ESC/POS® Command Reference for TM Printers

Jump to the top