Page 2
ESC/POS Command Manual 1. Control Command summary Command Function Horizontal tab Print and line feed Print and carriage return Print end position label to start printing Cancel print data in page mode DLE EOT Real-time status transmission DLE ENQ Real-time request to printer ESC FF Print data in page mode ESC SP...
Page 3
ESC/POS Command Manual GS r Transmit status GS v 0 Print raster bit image GS w Set bar code width...
Page 4
ESC/POS Command Manual 2. Command Descriptions Command Descriptions Command Notation [Name] The name of the control command. [Format] The code sequence. In this description, < > H denotes hexadecimal numbers, < >denotes decimal numbers and < > B denotes binary numbers. [ ] k indicates the contents of the [ ] should be repeated k times.
Page 5
ESC/POS Command Manual 3. Print Commands The LK-Px series supports the following commands for printing characters and advancing paper. [Name] Horizontal tab [Format] ASCII Decimal [Description] Moves the print position to the next tab position. [Details] This command is ignored unless the next tab position has been set. If the next horizontal tab position exceeds the printing area, the printer sets the printing position to [Printing area width + 1].
Page 6
ESC/POS Command Manual The automatic line feed is ignored. [Reference] [Name] Print and return to standard mode in page mode. [Format] ASCII Decimal [Description] Prints the data in the print buffer and returns to standard mode. [Details] The buffer data is deleted after being printed. The printing area set by ESC W is reset to the default setting.
Page 7
ESC/POS Command Manual =3 : Transmit error status =4 : Transmit paper roll sensor status [Details] The printer transmits the current status. Each status is represented by one-byte data. The printer transmits the status without confirming whether the host computer can receive data. The printer executes this command upon receiving it.
Page 8
ESC/POS Command Manual = 3: Error status Off/On Decimal Function Not used. Fixed to Off Not used. Fixed to On Undefined Not used. Fixed to On No unrecoverable error Unrecoverable error occurs No auto-recoverable error Auto recoverable error occurs Not used. Fixed to Off Bit 3: If these errors occur due to paper jams or the like, it is possible to recover by correcting the cause of the error and executing DLE ENQ n (1 ≤...
Page 9
ESC/POS Command Manual received. Example: In ESC * ** * m dk, d1 = <10>H, d2 = <05>H, d3 = <01>H nL nH This command should not be contained within another command that consists of two or more bytes. Example: If you attempt to transmit ESC 3 n to the printer, but DTR (DSR for the host computer) goes to MARK before n is transmitted, and DLE ENQ 2 interrupts before n is received, the code <10>H for DLE ENQ 2 is processed as the code for ESC 3 <10>H.
Page 10
ESC/POS Command Manual In page mode, the horizontal or vertical motion unit differs in page mode, depending on starting position of the printable area as follows: ① When the starting position is set to the upper left or lower right of the printable area using ESC T, the horizontal motion unit (x) is used.
Page 11
ESC/POS Command Manual command is effective. ESC - Can also turn on or off underline mode. However, the setting of the last received command effective. GS ! Can also select character size, However, the setting of the last received command is effective.
Page 12
ESC/POS Command Manual the internal character set is automatically selected. is available only for the least significant bit. [Default] n = 0 [Reference] ESC &, ESC ? ESC & y c1 c2 [x1 d1…d(y x x1)]..[ xk d1..d(y x xk)] [Name] Define user-defined characters [x1 d1...d(y ×...
Page 14
ESC/POS Command Manual [Range] 0, 1, 32, 33 0≤ ≤255 0≤ ≤3 0≤ ≤255 [Description] Selects a bit-image mode using for the number of dots specified by , as follows: Vertical Direction Horizontal Direction Mode NO. of Dots Dot Density Dot Density Number of (Data(K) 8-dot single-density...
ESC/POS Command Manual Decimal [Range] 0≤ ≤2, 48≤ ≤50 [Description] Turns underline mode on or off, based on the following values of Function 0, 48 Turns off underline mode 1, 49 Turns on underline mode (1-dot thick) 2, 50 Turns on underline mode (2-dots thick) [Details] The printer can underline all characters (including right-side character spacing), but cannot underline the space set by HT.
ESC/POS Command Manual [Details] The line spacing can be set independently in standard mode and in page mode. In standard mode, the vertical motions until (y) is used. In page mode, this command function as follows, depending on the starting position of the printable area : ①...
Page 17
ESC/POS Command Manual [Details] The DIP switch settings are not checked again. The data in the receive buffer is not cleared. The macro definition is not cleared. The NV bit image data is not cleared. The data of the NV user memory is not cleared. ESC D [ ] NUL [Name]...
ESC/POS Command Manual X 24). [Reference] ESC E [Name] Turn emphasized mode on/off [Format] ASCII Decimal [Range] 0≤ ≤255 [Description] Turns emphasized mode on or off. When the LSB of is 0, emphasized mode is turned off. When the LSB of is 1, emphasized mode is turned on.
ESC/POS Command Manual [Format] ASCII Decimal [Range] 0≤ ≤255 [Description] Prints the data in the print buffer and feeds the paper [ x vertical or horizontal motion unit]. [Details] After printing is completed, this command sets the print starting position to the beginning of the line.
ESC/POS Command Manual ③ Print raster bit image : GS v 0 The printer returns to standard mode when power is turned on, the printer is reset, or ESC @ is used. FF, CAN, ESC FF, ESC S, ESC T, ESC W, GS $, GS \ [Reference] ESC M n [Name]...
Page 21
ESC/POS Command Manual Latin America [Default] [Reference] 3.2.12 International Character Set ESC S [Name] Select standard mode [Format] ASCII Decimal [Description] Switches from page mode to standard mode. [Details] This command is effective only in page mode. Data buffered in page mode and the printable area developed in page mode are cleared. This command is switches the setting for the following command (in which the values can be set independently in standard mode and page mode) to those for standard mode: ①...
Page 22
ESC/POS Command Manual The following commands are ignored in standard mode. ① Set absolute vertical print position in page mode : GS $ ② Set relative vertical print position in page mode : GS \ Standard mode is selected automatically when power is turned on, the printer is reset, or command ESC @ is used.
Page 23
ESC/POS Command Manual [Reference] ESC $, ESC L, ESC W, ESC\, GS $, GS\ ESC V [Name] Turn 90° clockwise rotation mode on/off [Format] ASCII Decimal [Range] 0≤ ≤1,48≤ ≤49 [Description] Turns 90° clockwise rotation mode on or off. is used as follows: Function 0, 48 Turns off 90˚...
ESC/POS Command Manual The printing area is set as shown in the figure below. [Details] If this command is input in standard mode, the printer executes only internal flag operation. This command does not affect printing in standard mode. If the horizontal or vertical starting position is set outside the printable area, the printer stops command processing and processes the following data as normal data.
Page 25
ESC/POS Command Manual [Details] Any setting that exceeds the printable area is ignored. When pitch is specified to the right : When pitch is specified to the left (the negative direction), use the complement of 65536. When pitch is specified to the left : 65536 –...
ESC/POS Command Manual ESC d [Name] Print and feed lines [Format] ASCII Decimal [Range] 0≤ ≤255 [Description] Prints the data in the print buffer and feeds lines. [Details] This command sets the print starting position to the beginning of the line This command does not affect the line spacing set by ESC 2 or ESC 3.
Page 27
ESC/POS Command Manual CP862 Hebrew CP864 Arabic CP866 Cyrillic CP1252 Latin1(Spanish) CP1253 Greek ISO8859 Latin5(Turkish) ESC { [Name] Turns on/off upside-down printing mode [Format] ASCII Decimal 27 [Range] 0 ≤ n ≤ 255 [Description] Turns upside-down printing mode on or off. When the LSB of is 0, upside-down printing mode is turned off.
Page 28
ESC/POS Command Manual FS p [Name] Print NV bit image [Format] ASCII Decimal [Range] 1 ≤ ≤ 255 0 ≤ m ≤ 3, 48 ≤ m ≤ 51 [Description] Prints a NV bit image using the mode specified by Mode Vertical Dot Density Horizontal Dot Density 0, 48...
Page 29
ESC/POS Command Manual This command is not effective when the specified NV bit image has not been defined. In standard mode, this command is effective only when there is no data in the print buffer. In page mode, the command is not effective. This command is not affected by print modes (emphasized, double-strike, underline, character size, white/black reverse printing, or 90°...
Page 30
ESC/POS Command Manual [Details] specifies the number of the defined NV bit image. xL, xH specifies (xL + xH × 256) × 8 dots in the horizontal direction for the NV bit image you are defining. yL, yH specifies (yL + yH × 256) × 8 dots in the vertical direction for the NV bit image you are defining.
Page 31
ESC/POS Command Manual images specified by command FS p. A definition data of a NV bit image consists of [xL xH vL vH d1...dk]. Therefore, when only one NV bit image is defined n=1, the printer processes a data group [xL xH yL yH d1...dk] once. The printer uses ([data:(xL + xH ×256) ×...
Page 32
ESC/POS Command Manual (xL + xH x 256) x 8 dots = 512 dots GS ! [Name] Select character size [Format] ASCII Decimal [Range] 0 ≤ ≤ 255 (1 ≤ vertical number of times ≤ 8, 1 ≤ horizontal number of times ≤ 8) [Description] Selects the character height using bits 0 to 3 and selects the character width using bits 4 to 7, as follows:...
Page 33
ESC/POS Command Manual (normal) (normal) (double-width) 2 (double-height) [Details] This command is effective for all characters (except for HRI characters). If is outside of the defined range, this command is ignored. In standard mode, the vertical direction is the paper feed direction, and the horizontal direction is perpendicular to the paper feed direction.
Page 34
ESC/POS Command Manual d1...d GS ∗ x y (x × y × 8) [Name] Define downloaded bit image [Format] ASCII … x 8) ∗ … x 8) Decimal … x 8) [Range] 1 ≤ ≤ 255 1 ≤ ≤ 48 ≤...
Page 35
ESC/POS Command Manual GS \ [Reference] GS / [Name] Print down-loaded bit image [Format] ASCII Decimal [Range] 0 ≤ ≤ 3,48 ≤ ≤ 51 [Description] Prints a downloaded bit image using the mode specified by m selects a mode from the table below: Mode Vertical Dot Density Horizontal Dot Density...
Page 36
ESC/POS Command Manual ② If the printing area width cannot be extended by one line in vertical, the left margin is reduced to accommodate one line in vertical. [Reference] GS ∗ GS B [Name] Turn white/black reverse printing mode [Format] ASCII Decimal [Range]...
Page 37
ESC/POS Command Manual [Details] HRI means Human Readable Interpretation. HRI characters are printed using the font specified by GS f. [Default] [Reference] GS f, GS k nL nH GS L [Name] Set left margin [Format] ASCII Decimal [Range] 0 ≤ ≤...
Page 38
ESC/POS Command Manual nL nH GS W [Name] Set printing area width nL nH [Format] ASCII nL nH Decimal nL nH [Range] 0 ≤ ≤ 255 0 ≤ ≤ 255 [Description] Sets the printing area width to the area specified by The printing area width is set to [( x 256) x horizontal motion unit]].
Page 39
ESC/POS Command Manual ① Extended to right ② Left margin Reduce left margin ③ If the printing area width cannot be extended sufficiently, the right space is reduced. If the width set for the printing area is less than one line in vertical, the following processing is performed only on the line in question when data other than character data (e.g., bit image, user-defined bit image) is developed: ①...
Page 40
ESC/POS Command Manual Any setting that exceeds the specified printing area is ignored. This command function as follows, depending on the print starting position set by ESC T: ① When the starting position is set to the upper left or lower right of the printing, the vertical motion unit ( ) is used.
Page 41
ESC/POS Command Manual Off-line Not used. Fixed to On Cover is closed Cover is open Paper is not being fed by using the PAPER FEED button Paper is being fed by using the PAPER FEED button Not used. Fixed to Off Second byte (printer information) Off / On Decimal...
Page 42
ESC/POS Command Manual [Range] = 0, 1, 48, 49 [Description] selects a font for the HRI characters used when printing a bar code. selects the font from the following table: Font 0, 48 Font A (12 x 24) 1, 49 Font B (9 x 17) [Details] HRI means Human Readable Interpretation.
Page 43
ESC/POS Command Manual ① d1…dk [Format] ASCII d1…dn Decimal d1…dn ② d1…dn ASCII d1…dn d1…dn Decimal ① ≤ [Range] ≤ 6( k and d depends on the code system used) ② ≤ 73 and d depends on the code system used) ≤...
Page 44
ESC/POS Command Manual spacing specified by ESC 2 or ESC 3. This command is enabled only when on data exists in the print buffer. When data exists in the print butter, the printer processes the data following m as normal data. After printing bar code, this command sets the print position to the beginning of the line.
Page 45
ESC/POS Command Manual When CODE 128 (m = 73) is used: Refer to Appendix J for the information of the CODE 128 bar code and is code table. When using the CODE 128 in this printer, take the following points into account for data transmission: ①...
Page 46
ESC/POS Command Manual HRI characters for the control character (<00>H to <1F>H and <7F>H)are space. <Others> Be sure to keep spaces on both right and left sides of a bar code. (Spaces are different depending on the types of the bar code.) [Reference] GS H, GS f, GS h, GS w GS r...
Page 48
ESC/POS Command Manual The ESC a (Select justification) setting is also effective on raster bit image. When this command is received during macro definition, the printer ends macro definition, and begins performing this command. The definition of the command should be cleared. d indicates the bit-image data.
Need help?
Do you have a question about the LK-P11 and is the answer not in the manual?
Questions and answers