Brother RJ-4030 Software Manual

Esc/p command reference
Hide thumbs Also See for RJ-4030:
Table of Contents

Advertisement

Software Developer's Manual
ESC/P Command Reference
RJ-4030/4040
Version 1.0

Advertisement

Table of Contents
loading

Summary of Contents for Brother RJ-4030

  • Page 1 Software Developer's Manual ESC/P Command Reference RJ-4030/4040 Version 1.0...
  • Page 2 Each owner whose software title is mentioned in this document has a Software License Agreement specific to its proprietary programs. Any trade names and product names of companies appearing on Brother products, related documents and any other materials are all trademarks or registered trademarks of those respective companies.
  • Page 3 Any updates, upgrades or alteration of the Documentation or Printer Model will be performed at the sole discretion of Brother. Brother may not respond to any request or inquiry about the Documentation. b. THIS DOCUMENTATION IS PROVIDED TO YOU "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE.
  • Page 4: Table Of Contents

    ESC/P Command Reference Contents Introduction ·········································································································· 1 What is ESC/P? ···································································································· 2 1. Using ESC/P Commands················································································· 3 2. Examples of Using ESC/P Commands ·························································· 5 3. ESC/P Command Limitations········································································ 10 3.1 Print area......................10 3.2 Characters......................12 3.1.1 Character sizes..................12 3.1.2 Character pitches ..................13 3.3 Print position......................14 3.3.1 Characters ....................14 3.3.2 Bitmaps, barcodes and downloaded images ..........14...
  • Page 5 ESC/P Command Reference Carriage return ................41 ESC D Specify horizontal tab position ............42 Perform horizontal tab ..............43 ESC $ Specify absolute horizontal position..........44 ESC \ Specify relative horizontal position..........44 ESC a Specify alignment ................45 5.5 Vertical movement commands ................46 Line feed..................46 Page feed ..................46 ESC J Forward paper feed ...............47...
  • Page 6 ESC/P Command Reference ESC iXm1 Retrieve default character code set ..........99 Appendix A: Character Code Tables ······························································ 100 Character code tables .....................100 International character set table ................103 Appendix B: Introducing the Brother Developer Center······························ 104 - iii -...
  • Page 7: Introduction

    We accept no responsibility for any problems caused by programs that you develop using the information provided in this material, affecting software, data or hardware, including the RJ-4030/4040, and any problems resulting directly or indirectly from them. Use this material only if you accept these terms.
  • Page 8: What Is Esc/P

    ESC/P Command Reference What is ESC/P? ESC/P is one type of control codes used for printers. With the codes introduced in this document, various labels can be created and printed. In this document, ESC/P codes are provided as both ASCII and binary codes.
  • Page 9: Using Esc/P Commands

    ESC/P Command Reference 1. Using ESC/P Commands Below is a description of the flow for creating documents. Also refer to “2. Examples of Using ESC/P Commands”. (1) Start ESC/P 1. Switch the command mode. - Switch command mode (ESC i a) 2.
  • Page 10 ESC/P Command Reference (4) Text operations 1. Specify the character set. - Select font (ESC k) - Select character code (ESC t) - Select international character set (ESC R) - Specify character size (ESC X) - Specify the character spacing (ESC P, ESC M, ESC SP) 2.
  • Page 11: Examples Of Using Esc/P Commands

    ESC/P Command Reference 2. Examples of Using ESC/P Commands This is the label that will be made. Step 2: Page length 4 inches Step 1: Step 4: 1.8 inches Landscape Vertical position 1 inch Step 5: Step 3: Font type: Helsinki Horizontal position (proportional pitch)
  • Page 12 ESC/P Command Reference Step 2: Specify the page length. 4 inches 4 inches=812 dots *The page length does not include the margins. dots–48 dots=764 dots For the margins, subtract 6 mm (48 dots) from the page length. Page length=mL+mH*256=764 Entered command ESC ( C 02h 00h FCh 02h Step 3: Specify the horizontal position.
  • Page 13 ESC/P Command Reference Step 4: Specify the vertical position. 1.8 inches 1.8 inch=365 dots Entered command Vertical position=n1+n2*256=365 ESC ( V 02h 00h 6Dh 01h Step 5: Select the font type. Font type: Helsinki (proportional pitch) Entered command n=11=0Bh ESC k L 0Bh - 7 - 2.
  • Page 14 ESC/P Command Reference Step 6: Specify the character size. Character size: 100 dots Character size=n1+n2*256=100 dots Entered command ESC X 00h 64h 00h - 8 - 2. Examples of Using ESC/P Commands...
  • Page 15 ESC/P Command Reference All commands together will make the example label shown below. Select ESC/P mode Binary command: 1B 69 61 00 ESC i a 00h ESC @ Initialize ESC/P mode ESC i L 01h Binary command: 1B 40 ESC ( C 02h 00h FCh 02h 6 steps explained above ESC $ 2Bh 00h ESC ( V 02h 00h 6Dh 01h...
  • Page 16: Esc/P Command Limitations

    ESC/P Command Reference 3. ESC/P Command Limitations 3.1 Print area The printing media are die-cut labels and continuous length tape. The area that can physically be printed on depends on the size and type of the print media. Die-cut labels Top margin Bottom margin Unprintable area...
  • Page 17 ESC/P Command Reference The print area for each media is described below. Print area Label spacing Label length No.832 Top margin Printable area Bottom margin Left margin Length of printable area Right margin No.001 * To specify media settings, use the Custom Label Tool. - 11 - 3.
  • Page 18: Characters

    ESC/P Command Reference 3.2 Characters This system uses single-byte character codes and is installed with two bitmap fonts (Letter Gothic Bold and Helsinki) and 2 outline fonts (Letter Gothic and Helsinki). Fixed pitch or proportional pitch (PS pitch) can be specified for any of the fonts. However, there are fonts that are better with a fixed pitch and fonts that are better with a proportional pitch (PS pitch).
  • Page 19: Character Pitches

    ESC/P Command Reference 3.1.2 Character pitches Pitch refers to the spacing between neighboring characters. When characters are arranged with a fixed pitch, they will be evenly spaced. If characters extend over several lines, they will align in straight rows. Fixed spacing Fixed spacing When characters are arranged with a proportional pitch, the spacing will vary depending on the character.
  • Page 20: Print Position

    ESC/P Command Reference 3.3 Print position The print position is the standard position for printing characters, bitmaps, and barcodes. There is a horizontal print position and vertical print position, which are the reference points for vertical position movement and horizontal position movement. 3.3.1 Characters Characters are arranged with their top edges aligned with the print position.
  • Page 21: Line Feed Amount

    ESC/P Command Reference 3.4 Line feed amount The amount of line feed is the amount of vertical movement from the print position of one line to the print position of the next line. HHHHHHHHHHHHH Line feed amount HHHHHHHHHHHHH HHHHHHHHHHHHH The line feed amount is specified with ESC 0, ESC 2, ESC A, and ESC 3. Within a single line of text, the tallest character is determined, and the baseline is moved so that the top edge of that character is at the vertical print position.
  • Page 22: Control Code List

    ESC/P Command Reference 4. Control Code List Character/style selection commands (Refer to section 5.1 Character/style selection commands.) ASCII Code Binary Code Description ESC R 1B 52 Select international character set ESC q 1B 71 Select character style ESC k 1B 6B Select font ESC t 1B 74...
  • Page 23 ESC/P Command Reference Line feed commands (Refer to section 5.3 Line feed commands.) ASCII Code Binary Code Description ESC 0 1B 30 Specify line feed of 1/8 inch ESC 2 1B 32 Specify line feed of 1/6 inch ESC 3 1B 33 Specify minimum line feed ESC A...
  • Page 24 ESC/P Command Reference Printer control commands (Refer to section 5.7 Printer control commands.) ASCII Code Binary Code Description ESC @ 1B 40 Initialize (defaults) Graphics commands (Refer to section 5.8 Graphics commands.) ASCII Code Binary Code Description ESC * 1B 2A Select bit image.
  • Page 25 ESC/P Command Reference Advanced static commands (Refer to section 5.10 Advanced static commands.) ASCII Code Binary Code Description ESC iXQ2 1B 69 58 51 32 Select default character style ESC iXQ1 1B 69 58 51 31 Retrieve default character style ESC iXk2 1B 69 58 6B 32 Select default font...
  • Page 26: Control Command Details

    ESC/P Command Reference 5. Control Command Details 5.1 Character/style selection commands ESC R Select international character set ASCII: Decimal: Hexadecimal: 1B Parameters 0≤n≤13, 64 Description Selects the character set, and switches some of the character codes in the code table according to the value of n.
  • Page 27: Esc Q Select Character Style

    ESC/P Command Reference ESC q Select character style ASCII: Decimal: Hexadecimal: 1B Parameters 0≤n≤3 Description Selects the character style. n=0: None (normal characters) n=1: Outline n=2: Shadow n=3: Shadow and outline Example Code: ABC ESC q 02h ABC ESC q 00h ABC FF Print result: ABC - 21 - 5.
  • Page 28: Esc K Select Font

    ESC/P Command Reference ESC k Select font ASCII: Decimal: Hexadecimal: 1B Parameters 0≤n≤4, 9≤n≤11 Description Selects the font. Bitmap Fonts Outline Fonts Reserved Letter Gothic (fixed pitch) Letter Gothic Bold (fixed pitch) n=10 Reserved Reserved n=11 Helsinki (proportional pitch) Helsinki (proportional pitch) Reserved The default value is n=1 (Letter Gothic Bold (fixed pitch)).
  • Page 29: Text Printing Commands

    ESC/P Command Reference 5.2 Text printing commands ESC 4 Apply italic style ASCII: Decimal: Hexadecimal: 1B Parameters None Description Prints the subsequent text in italics. This command is valid anywhere in a text line. ESC 5 Cancel italic style ASCII: Decimal: Hexadecimal: 1B Parameters...
  • Page 30: Esc E Apply Bold Style

    ESC/P Command Reference ESC E Apply bold style ASCII: Decimal: Hexadecimal: 1B Parameters None Description Prints the subsequent text in bold. This command is valid anywhere in a text line. ESC F Cancel bold style ASCII: Decimal: Hexadecimal: 1B Parameters None Description Cancels the bold style.
  • Page 31: Esc G Apply Double-Strike Printing

    ESC/P Command Reference ESC G Apply double-strike printing ASCII: Decimal: Hexadecimal: 1B Parameters None Description Prints the subsequent text in bold. This command is valid anywhere in a text line. ESC H Cancel double-strike printing ASCII: Decimal: Hexadecimal: 1B Parameters None Description Cancels the bold style.
  • Page 32: Esc P Apply Pica Pitch (10 Cpi)

    ESC/P Command Reference ESC P Apply pica pitch (10 cpi) ASCII: Decimal: Hexadecimal: 1B Parameters None Description Prints the subsequent text with the pica pitch (10 characters/inch). The character spacing is 20 dots (=203 dots/10 characters). If the character width is 20 dots or less, the character spacing is specified as 20 minus the character width. If the character width exceeds 20 dots, the character spacing is specified as the character width.
  • Page 33: Esc M Apply Elite Pitch (12 Cpi)

    ESC/P Command Reference ESC M Apply elite pitch (12 cpi) ASCII: Decimal: Hexadecimal: 1B Parameters None Description Prints the subsequent text with the elite pitch (12 characters/inch). The character spacing is 16 dots (=203 dots/12 characters). If the character width is 16 dots or less, the character spacing is specified as 16 minus the character width. If the character width exceeds 16 dots, the character spacing is specified as the character width.
  • Page 34: Esc P Specify Proportional Characters

    ESC/P Command Reference ESC p Specify proportional characters ASCII: Decimal: Hexadecimal: 1B Parameters n=0, 1, 48 (“0”), 49 (“1”) Description Specifies proportional characters. n=1 or 49 (“1”): Specifies proportional characters. n=0 or 48 (“0”): Cancels proportional characters. If proportional characters are specified, the character spacing specified with ESC SP is maintained as is. ESC W Specify double-width characters ASCII:...
  • Page 35: So Specify Auto-Canceling Stretched Characters

    ESC/P Command Reference Specify auto-canceling stretched characters ASCII: Decimal: Hexadecimal: 0E Parameters None Description Prints the subsequent text at double width. This command is canceled with DC4, LF, VT, FF, or an automatic line feed. This command is canceled with ESC $ or ESC \. This command can also be canceled with ESC W+0.
  • Page 36: Si Specify Compressed Characters

    ESC/P Command Reference Specify compressed characters ASCII: Decimal: Hexadecimal: 0F Parameters None Description Prints the subsequent text at half width. ESC SI Specify compressed characters ASCII: Decimal: Hexadecimal: 1B Parameters None Description Same as SI - 30 - 5. Control Command Details...
  • Page 37: Dc2 Cancel Compressed Characters

    ESC/P Command Reference Cancel compressed characters ASCII: Decimal: Hexadecimal: 12 Parameters None Description Cancels compressed characters specified with SI. DC 4 Cancel auto-canceling double-width characters ASCII: Decimal: Hexadecimal: 14 Parameters None Description Cancels double-width characters specified with ESC SO or SO. Does not cancel the ESC W command.
  • Page 38: Esc - Apply/Cancel Underlining

    ESC/P Command Reference ESC – Apply/cancel underlining ASCII: Decimal: Hexadecimal: 1B Parameters n=0, 1, 2, 3, 4 or 48 (“0”), 49 (“1”), 50 (“2”), 51 (“3”), 52 (“4”) Description Applies or cancels underlining. n=4 or 52 (“4”): Applies underlining with a width of 4 dots. n=3 or 51 (“3”): Applies underlining with a width of 3 dots.
  • Page 39: Esc ! Global Formatting

    ESC/P Command Reference ESC ! Global formatting ASCII: Decimal: Hexadecimal: 1B Parameters 0≤n≤255 Description Specifies a combination of print modes. Specifies modes depending on the bit value of n. When the ESC ! code is used, a combination of multiple print modes can be specified at one time. The priority order is from Bit 5 to Bit 2.
  • Page 40: Esc Sp Specify Character Spacing

    ESC/P Command Reference ESC SP Specify character spacing ASCII: Decimal: Hexadecimal: 1B Parameters 0≤n≤127 Description Specifies the character spacing. n indicates the number of dots. The default setting is 0 dot. With double-width characters, the character spacing is doubled; with half-width characters, it is halved. - 34 - 5.
  • Page 41: Esc X

    ESC/P Command Reference ESC X Specify character size ASCII: Decimal: Hexadecimal: 1B Parameters Character width: The value of m is irrelevant. Character size: <Bitmap fonts> <Outline fonts> Valid only with: The maximum is: nL=16, 24, 32 dots nL=144 nH=0 nH=1 Description This command is used only to change the size.
  • Page 42: Line Feed Commands

    ESC/P Command Reference 5.3 Line feed commands ESC 0 Specify line feed of 1/8 inch ASCII: Decimal: Hexadecimal: 1B Parameters None Description Specifies a line feed of 1/8 inch (about 0.32 cm). Specifies a line feed of 25/203 inch (=25 dots). ESC 2 Specify line feed of 1/6 inch ASCII:...
  • Page 43: Esc 3 Specify Minimum Line Feed

    ESC/P Command Reference ESC 3 Specify minimum line feed ASCII: Decimal: Hexadecimal: 1B Parameters 0≤n≤255 Description Specifies a line feed of n/203 inch per line. The line feed is specified in 1-dot units. ESC A Specify line feed of n/60 inch ASCII: Decimal: Hexadecimal: 1B...
  • Page 44: Horizontal Movement Commands

    ESC/P Command Reference 5.4 Horizontal movement commands ESC l Specify left margin ASCII: Decimal: Hexadecimal: 1B Parameters 0≤n≤255 0≤left margin<right margin Description The left margin and the right margin use the left edge of the physically printable area as the reference. The area between the left edge of the physically printable area and the specified number of columns is specified as an unprinted area.
  • Page 45 ESC/P Command Reference The horizontal print position is moved to the left margin position. If the left margin setting is not at the beginning of the line, the left margin is specified after a line feed. The beginning of the line indicates the left margin position for left alignment; for right and center alignment, it means that no image or character is entered on the line.
  • Page 46: Esc Q Specify Right Margin

    ESC/P Command Reference ESC Q Specify right margin ASCII: Decimal: Hexadecimal: 1B Parameters 1≤n≤255 Left margin<character width (when the command was specified)*n≤printable area Description The left margin and the right margin use the left edge of the physically printable area as the reference. The right margin position is the right edge of the specified column.
  • Page 47: Cr Carriage Return

    ESC/P Command Reference Carriage return ASCII: Decimal: Hexadecimal: 0D Parameters None Description Ends input of a line, and waits for input of the next line. The next print position becomes the beginning of the next line. A line feed command immediately after the carriage return is ignored. Auto-canceling double-width characters specified with SO or ESC SO are canceled.
  • Page 48: Esc D Specify Horizontal Tab Position

    ESC/P Command Reference ESC D Specify horizontal tab position ASCII: [n] Decimal: [n] Hexadecimal: 1B [n] Parameters 1≤n≤255, 0≤k≤32 Description The horizontal tab position is the character width (when the command was specified)*n from the left margin. Enter n values in ascending order and end the settings with NUL. If an n value is smaller than a previous one, tab setting is ended.
  • Page 49: Ht Perform Horizontal Tab

    ESC/P Command Reference Perform horizontal tab ASCII: Decimal: Hexadecimal: 09 Parameters None Description Moves the horizontal print position to the nearest horizontal tab position to the right of the input position. If there is no horizontal tab position to the right of the input position, or if the next horizontal tab position is beyond the right margin, the HT command is ignored.
  • Page 50: Esc $ Specify Absolute Horizontal Position

    ESC/P Command Reference ESC $ Specify absolute horizontal position ASCII: Decimal: Hexadecimal: 1B Parameters 0≤n1≤255, 0≤n2≤255 Description Specifies the absolute print position (in dots) for the next data. An absolute print position specifies the next print position as a number of dots from the left margin. n1 and n2 indicate the number of dots from the left margin.
  • Page 51: Esc A Specify Alignment

    ESC/P Command Reference ESC a Specify alignment ASCII: Decimal: Hexadecimal: 1B Parameters 0≤n≤3 or “0”≤n≤“3” Description Prints the subsequent text with the alignment described below, according to the value of n. n=0 or 48 (“0”): Applies left alignment. n=1 or 49 (“1”): Applies center alignment. n=2 or 50 (“2”): Applies right alignment.
  • Page 52: Vertical Movement Commands

    ESC/P Command Reference 5.5 Vertical movement commands Line feed ASCII: Decimal: Hexadecimal: 0A Parameters None Description Feeds the paper by the amount specified by a line feed command (ESC 0, ESC 2, ESC 3, ESC A). The print position becomes the beginning of the next line. The default value is a line feed of 32 dots.
  • Page 53: Esc J Forward Paper Feed

    ESC/P Command Reference ESC J Forward paper feed ASCII: Decimal: Hexadecimal: 1B Parameters 0≤n≤255 Description Ends input for the current line and moves the vertical print position forward by n/203 inch (=1 dot). If the bottom margin setting is exceeded, printing starts. With left alignment, the print position for the next line becomes the end position of the current line.
  • Page 54: Esc B Specify Vertical Tab Position

    ESC/P Command Reference ESC B Specify vertical tab position ASCII: [n] Decimal: [n] Hexadecimal: 1B [n] Parameters 1≤n≤255 0≤k≤16 Description The vertical tab position is the line feed amount (when this command was specified)*n from the top margin. Enter n values in ascending order and end the settings with NUL. If an n value is smaller than a previous one, tab setting is ended.
  • Page 55: Vt Perform Vertical Tab

    ESC/P Command Reference Perform vertical tab ASCII: Decimal: Hexadecimal: 0B Parameters None Description Moves the print position to the nearest vertical tab position down from the input position. The next horizontal print position becomes the beginning of the line. If the next vertical tab position extends beyond the bottom margin, or if there is no vertical tab position specified below the current position, VT is performed as if it is (moves to the TOF position of the next page).
  • Page 56: Esc

    ESC/P Command Reference ESC (V Specify absolute vertical position ASCII: ( nL nH Decimal: nL nH Hexadecimal: 1B nL nH Parameters nL=2 nH=0 0≤mL≤255 0≤mH≤127 Description Specifies the vertical print position as an absolute position from the top margin position. Vertical position=mL+mH*256+top margin The absolute vertical position is measured from the top margin position when this command was specified.
  • Page 57: Specify Relative Vertical Position

    ESC/P Command Reference ESC (v Specify relative vertical position ASCII: ( nL nH Decimal: nL nH Hexadecimal: 1B nL nH Parameters nL=2 nH=0 0≤mL≤255 0≤mH≤127 -16384≤(mL+mH*256)≤16383 Description Specifies the vertical print position as a relative position from the current position. Vertical position after movement=mL+mH*256+current position When moving upwards, the specified value is expressed as a two's complement.
  • Page 58: Paper Formatting Commands

    ESC/P Command Reference 5.6 Paper formatting commands ESC (c Specify page format ASCII: ( Decimal: Hexadecimal: 1B Parameters nL=4, nH=0 (tL+tH*256)<(BL+BH*256) Top margin<bottom margin Description Specifies settings for the top and bottom margins. The physically printable area depends on the media. The top margin and the bottom margin are specified in units of 1/203 inch (=1 dot) using the top edge of the physically printable area as the reference.
  • Page 59: Esc

    ESC/P Command Reference ESC (C Specify page length ASCII: Decimal: Hexadecimal: 1B Parameters nL=2, nH=0 0<(mL+mH*256)<8000 Description Specifies the page length. The unit is 1/203 inch (=1 dot). Page length=mL+mH*256 The current paper position is the TOF. The top and bottom margins are canceled with ESC ( c. All previously entered text is cleared.
  • Page 60: Printer Control Commands

    ESC/P Command Reference 5.7 Printer control commands ESC @ Initialize ASCII: Decimal: Hexadecimal: 1B Parameters None Description Returns all commands to their default settings. (See below.) Item Default Input buffer Saved Text buffer Cleared Print buffer Cleared Top margin 0 dot Bottom margin Depends on media Left margin...
  • Page 61: Graphics Commands

    ESC/P Command Reference 5.8 Graphics commands ESC * Select bit image ASCII: Data Decimal: Data Hexadecimal: 1B Data Parameters m=0, 1, 2, 3, 4, 6, 32, 33, 38, 39, 40, 71, 72, 73 0≤n1≤255, 0≤n2≤11 The image data is as follows: - n1+n2*256 bytes when m=0, 1, 2, 3, 4, 6 - (n1+n2*256)*3 bytes when m=32, 33, 38, 39, 40 - (n1+n2*256)*6 bytes when m=71, 72, 73...
  • Page 62 ESC/P Command Reference When m=0, 1, 2, 3, 4, 6 n1 and n2 indicate the number of dot positions. n1: The remainder from dividing the number of dot positions by 256 n2: The quotient from dividing the number of dot positions by 256 Relationship between the image data and the dots First, the data is lined up in one row as follows: …...
  • Page 63 ESC/P Command Reference When m=32, 33, 38, 39 n1 and n2 indicate the number of dot positions. n1: The remainder from dividing the number of dot positions by 256 n2: The quotient from dividing the number of dot positions by 256 byte byte byte...
  • Page 64 ESC/P Command Reference One dot of the image data is enlarged as follows, according to the value of m. m=32 m=33 m=38 m=39 As a result, the image is sized depending on the value of m, as follows: m=32 32 dots vertically×(n1+n2*256)*4 dots horizontally m=33 24 dots vertically×(n1+n2*256)*2 dots horizontally m=38...
  • Page 65: Esc K 8-Dot Single-Density Bit Image

    ESC/P Command Reference ESC K 8-dot single-density bit image ASCII: Data Decimal: Data Hexadecimal: 1B Data Parameters 0≤n1≤255, 0≤n2≤3 The data contains n1+n2*256 bytes of image data. Description Specifies that an 8-dot single-density bit image is printed with the number of dot positions indicated by n1 and n1 and n2 indicate the number of dot positions.
  • Page 66: Esc L 8-Dot Double-Density Bit Image

    ESC/P Command Reference ESC L 8-dot double-density bit image ASCII: Data Decimal: Data Hexadecimal: 1B Data Parameters 0≤n1≤255, 0≤n2≤3 The data contains n1+n2*256 bytes of image data. Description Specifies that an 8-dot double-density bit image is printed with the number of dot positions indicated by n1 and n2.
  • Page 67: Esc Y 8-Dot Double-Speed Double-Density Bit Image

    ESC/P Command Reference ESC Y 8-dot double-speed double-density bit image ASCII: Data Decimal: Data Hexadecimal: 1B Data Parameters 0≤n1≤255, 0≤n2≤3 The data contains n1+n2*256 bytes of image data. Description Same as for an 8-dot double-density bit image. Horizontally neighboring dots are not omitted. ESC Z 8-dot quadruple-density bit image ASCII:...
  • Page 68: Advanced Commands

    ESC/P Command Reference 5.9 Advanced commands ESC i B Barcode ASCII: i [Parameters] B or b [Barcode data] Backslash Decimal: 105 [Parameters] 66 or 98 [Barcode data] Hexadecimal: 1B 69 [Parameters] 42 or 62 [Barcode data] Format: i [Parameters] B or b [Barcode data] [Backslash] Parameters (1) [Parameters]: Barcode parameters...
  • Page 69 ESC/P Command Reference h (height) h n1 n2 Height=n1+n2*256 (dots) 48≤height≤480 If height<48, height=48. If height>480, height=480. However, the height is as shown below with tc. 131≤height≤832 (RSS-14 Standard) 71≤height≤832 (RSS-14 Truncated) 71≤height≤832 (RSS-14 Stacked) 239≤height≤832 (RSS-14 Stacked Omni) 62≤height≤832 (RSS Limited) 134≤height≤832 (RSS Expanded) If height<min., height=min.
  • Page 70 ESC/P Command Reference Note * For parameter numerals 0–9, both 00h–09h and 30h–39h are recognized. * The parameter types a, b and c are recognized even when uppercase. * The parameter “parentheses deletion” is available only when GS1-128 (UCC/EAN-128) is selected. * The parameter “ratio between thick and thin bars”...
  • Page 71 ESC/P Command Reference (4) [Backslash]: End of barcode Barcode Type Command POSTNET, UPC/EAN EXTENTION, CODE39, ITF(I-2/5), EAN-8, EAN-13, UPC-A, UPC-E, ESC i [Parameter] B or b [Barcode data] \ CODABAR, RSS symbols CODE93, CODE128, ESC i [Parameter] B or b [Barcode data] \\\ GS1-128 (UCC/EAN-128)] Description Specifies a barcode image.
  • Page 72: Esc I Q 2D Barcode (Qr Code)

    ESC/P Command Reference ESC i Q 2D barcode (QR Code) ASCII: Q or q Data Decimal: 105 81 or 113 Data Hexadecimal: 1B 51 or 71 Data Format: Q or q [Parameters] [Barcode data] Parameters (1) [Parameters] Unlike with 1D barcodes, all parameters must be specified in order, starting from the top. If a value other than those listed is entered for a parameter, that parameter is specified with its default value.
  • Page 73 ESC/P Command Reference (*1) With Micro QR, the Structured Append setting is invalid, and the default setting is used. (*2) With Micro QR, error correction level 4 is invalid, and the default setting is used. (*3) Some barcode readers cannot recognize a barcode with the cell size specified as 1 dot or 2 dots. What is the QR Code Structured Append setting? QR Codes have Structured Append settings.
  • Page 74 ESC/P Command Reference Summary Printing the character string “123456789” with a cell size of 4 dots, Model 2, standard error correction level, and automatic data input Without Structured ESC i Q 04h 02h 00h 00h 00h 00h 02h 00h “123456789” \\\ Append With Structured ESC i Q 04h 02h 01h 01h 03h 31h 02h 00h “123”...
  • Page 75: Esc I Pqr Code Version

    ESC/P Command Reference (3) \\\: End of barcode There must be three backslashes to end 2D barcode. Example Refer to the section “Summary”. ESC i P QR Code version ASCII: Decimal: Hexadecimal: 1B Parameters 0≤n≤40 Description The barcode size can be fixed. The default value is 0.
  • Page 76: Esc I V

    ESC/P Command Reference ESC i V 2D barcode (PDF417) ASCII: V or v Data Decimal: 86 or 118 Data Hexadecimal: 1B 56 or 76 Data Format: V or v [Parameters] [Barcode data] Parameters (1) [Parameters] Unlike with 1D barcodes, all parameters must be specified in order, starting from the top. If a value other than those listed is entered for a parameter, that parameter is specified with its default value.
  • Page 77 ESC/P Command Reference 8. Aspect [2-byte decimal] 1–1000 Specifies the aspect value. value Actually, this is 0.01–10.0, but since the decimal point cannot be entered, a value multiplied by 100 is entered. The default value is 50. (The actual value is 0.5.) Note * Some barcode readers cannot recognize a barcode with the cell size specified as 1 dot or 2 dots.
  • Page 78 ESC/P Command Reference [With symbol type MicroPDF417] Maximum of 250 alphanumeric characters, maximum of 366 numbers, maximum of 150 bytes of binary data However, the following table shows the maximum amount of information allowed according to the settings for symbol size (X direction) and symbol size (Y direction). Maximum Amount of Information Allowed Alphanumeric Numbers...
  • Page 79: Esc I D 2D Barcode (Datamatrix)

    ESC/P Command Reference ESC i D 2D barcode (DataMatrix) ASCII: D or d data Decimal: 68 or 100 data Hexadecimal: 1B 44 or 64 data Format: D or d [Parameters] [Barcode data] Parameters (1) [Parameters] Unlike with 1D barcodes, all parameters must be specified in order, starting from the top. If a value other than those listed is entered for a parameter, that parameter is specified with its default value.
  • Page 80 ESC/P Command Reference 3. Vertical (continued from the previous page) size [1-byte decimal] 104 Vertical no. of cells: 104 cells (continued) [1-byte decimal] 120 Vertical no. of cells: 120 cells [1-byte decimal] 132 Vertical no. of cells: 132 cells [1-byte decimal] 144 Vertical no.
  • Page 81 ESC/P Command Reference (3) \\\: End of barcode There must be three backslashes to end 2D barcodes. Example For data “12345” with symbol type ECC square at 40 × 40 with a 3-dot cell size, the command will be as shown below.
  • Page 82: Esc I M 2D Barcode (Maxicode)

    ESC/P Command Reference ESC i M 2D barcode (MaxiCode) ASCII: M or m data Decimal: 77 or 109 data Hexadecimal: 1B 4D or 6D data Format: M or m [Parameters] [Barcode data] Parameters (1) [Parameters] If a value other than those listed is entered for a parameter, that parameter is specified with its default value.
  • Page 83 ESC/P Command Reference When the symbol type is the structured carrier message, the service class, country code and postal code can be specified separately from the normal data. Specify each value, separated by a backslash and comma (\,), immediately before the normal data. <postal_code>\,<country_code>\,<service_class>\,<normal_barcode_data>...
  • Page 84: Esc I F Print Downloaded Data

    ESC/P Command Reference ESC i F Print downloaded data ASCII: Decimal: 80 n Hexadecimal: 1B 50 n Parameters n: file header index 0≤n≤98 Description Expands downloaded data in the print buffer as image data. Expands downloaded image data from the print position. If there is no image data, this command is ignored.
  • Page 85 ESC/P Command Reference As with text, if the image data does not all fit on the current line, an automatic line feed is performed, and the data is placed at the beginning of the next line. At that time, the any data that does not fit in the print area is deleted.
  • Page 86 ESC/P Command Reference If the result of pasting in the downloaded image extends beyond the bottom margin position, the image is pasted in after a page feed. However, if the downloaded image is larger than the entire area between the top and bottom margins, the entire image is ignored.
  • Page 87 ESC/P Command Reference There are limits on the amount of image data that can be stored in the printer. The size of the storage area is 2,048 KB. However, bitmap data is not stored as is, but is converted into the printer storage format by Transfer Manager.
  • Page 88: Esc I A Switch Command Mode

    ESC/P Command Reference ESC i a Switch command mode ASCII: Decimal: Hexadecimal: 1B Parameters Command mode 0 or 48: ESC/P standard mode 1 or 49: Raster graphics mode 3 or 51: P-touch Template mode Description Switches the command mode to ESC/P, P-touch Template or PTCBP (raster graphics) mode. Dynamically switches between the three modes.
  • Page 89: Esc I S Status Information Request

    Size Fixed at 20h Brother code Fixed at “B” (42h) Series code Fixed at “7” (37h) RJ-4030: Fixed at “1” (31h) Model code RJ-4040: Fixed at “2” (32h) Country code Fixed at “0” (30h) Battery level information Refer to table (5) below.
  • Page 90 ESC/P Command Reference (1) Error information 1 Flag Mask Meaning Bit 0 “No media” error Bit 1 “End of media” error Bit 2 “Cutter jam” error Bit 3 Not used Bit 4 Printer in use Bit 5 Printer turned off Bit 6 Not used Bit 7...
  • Page 91: Esc I L Specify Landscape Orientation

    ESC/P Command Reference ESC i L Specify landscape orientation ASCII: Decimal: Hexadecimal: 1B Parameters n=0, 1 or 48, 49 Description Applies or cancels the landscape orientation n=1 or 49 (“1”): Applies the landscape orientation. n=0 or 48 (“0”): Cancels the landscape orientation. Using this command clears all text.
  • Page 92: Esc I C Specify Cutting

    ESC/P Command Reference ESC i C Specify cutting ASCII: Decimal: Hexadecimal: 1B Parameters n=0, 1 or 48, 49 Description Specifies cutting after printing. n=1 or 49 (“1”): Specifies cutting. n=0 or 48 (“0”): Cancels cutting. The default auto cut setting can be changed with the P-touch Template Settings Tool (P-touch Template Settings.exe).
  • Page 93: Advanced Static Commands

    ESC/P Command Reference 5.10 Advanced static commands ESC iXQ2 Select default character style ASCII: Decimal: Hexadecimal: 1B Parameters n1: 01h (Fixed) n2: 00h (Fixed) 00h≤n3≤04h Description Selects the default character style. n3=00h: None (normal characters) (*Manufacturer’s default) n3=01h: Bold n3=02h: Outline n3=03h: Shadow n3=04h: Shadow and outline This command is a static command.
  • Page 94: Esc Ixq1 Retrieve Default Character Style

    ESC/P Command Reference ESC iXQ1 Retrieve default character style ASCII: Decimal: Hexadecimal: 1B Parameters n1: 00h (Fixed) n2: 00h (Fixed) Description The default character style setting is returned as 3-byte data. [1] 01h (Fixed) [2] 00h (Fixed) [3] Setting 00h: None (normal characters) 01h: Bold 02h: Outline 03h: Shadow...
  • Page 95: Esc Ixk2 Select Default Font

    ESC/P Command Reference ESC iXk2 Select default font ASCII: Decimal: Hexadecimal: 1B Parameters n1: 01h (Fixed) n2: 00h (Fixed) 00h≤n3≤04h, 09h≤n3≤0Bh Description Selects the default font. n3=00h: Reserved n3=01h: Letter Gothic Bold (bitmap) (*Manufacturer’s default) n3=02h: Reserved n3=03h: Helsinki (bitmap) n3=04h: Reserved n3=09h: Letter Gothic (outline) n3=0Ah: Reserved...
  • Page 96: Esc Ixk1 Retrieve Default Font

    ESC/P Command Reference ESC iXk1 Retrieve default font ASCII: Decimal: Hexadecimal: 1B Parameters n1: 00h (Fixed) n2: 00h (Fixed) Description The default font setting is returned as 3-byte data. [1] 01h (Fixed) [2] 00h (Fixed) [3] Setting 01h: Letter Gothic Bold (bitmap) 03h: Helsinki (bitmap) 09h: Letter Gothic (outline) 0Bh: Helsinki (outline)
  • Page 97: Esc Ixx2 Specify Default Character Size

    ESC/P Command Reference ESC iXX2 Specify default character size ASCII: Decimal: Hexadecimal: 1B Parameters n1: 02h (Fixed) n2: 00h (Fixed) 00h≤n3≤FFh, 00h≤n4≤01h Description Specifies the default character size. n3+(n4*256): Default character size (dots) The following settings (dots) are valid. The maximum valid setting is n=400. *The manufacturer’s default is 24.
  • Page 98: Esc Ixx1 Retrieve Default Character Size

    ESC/P Command Reference ESC iXX1 Retrieve default character size ASCII: Decimal: Hexadecimal: 1B Parameters n1: 00h (Fixed) n2: 00h (Fixed) Description The default character size setting is returned as 4-byte data. 02h (Fixed) 00h (Fixed) [3, 4] n3 n4 settings n3+(n4*256): Default character size (dots) The retrieved value is a value specified by a static command.
  • Page 99: Esc Ix31 Retrieve Default Line Feed

    ESC/P Command Reference ESC iX31 Retrieve default line feed ASCII: Decimal: Hexadecimal: 1B Parameters n1: 00h (Fixed) n2: 00h (Fixed) Description The default line feed setting is returned as 4-byte data. 02h (Fixed) 00h (Fixed) [3, 4] n3 n4 settings n3+(n4*256): Default line feed (dots) The retrieved value is a value specified by a static command.
  • Page 100: Esc Ixa1 Retrieve Default Alignment

    ESC/P Command Reference ESC iXA1 Retrieve default alignment ASCII: Decimal: Hexadecimal: 1B Parameters n1: 00h (Fixed) n2: 00h (Fixed) Description The default alignment setting is returned as 3-byte data. [1] 01h (Fixed) [2] 00h (Fixed) [3] Setting 00h: Left alignment 01h: Center alignment 02h: Right alignment The retrieved value is a value specified by a static command.
  • Page 101: Esc

    ESC/P Command Reference ESC iX(2 Specify default page length ASCII: Decimal: Hexadecimal: 1B Parameters n1: 02h (Fixed) n2: 00h (Fixed) 00h≤n3≤FFh, 00h≤n4≤2Eh Description Specifies the default page length. n3+(n4*256): Default page length (dots) (0, 229 through 11999) *A default page length of 0 indicates the Auto setting. *The manufacturer’s default is 0.
  • Page 102: Esc Ixl2 Select Default Landscape Orientation

    ESC/P Command Reference ESC iXL2 Select default landscape orientation ASCII: Decimal: Hexadecimal: 1B Parameters n1: 01h (Fixed) n2: 00h (Fixed) 00h≤n3≤01h Description Selects the default landscape orientation setting. n3=00h: Cancel landscape orientation (*Manufacturer’s default) n3=01h: Apply landscape orientation This command is a static command. Remarks Invalid if n3 is a value outside of the allowable range ESC iXL1 Retrieve default landscape orientation...
  • Page 103: Esc Ixj2 Select Default International Character Set

    ESC/P Command Reference ESC iXj2 Select default international character set ASCII: Decimal: Hexadecimal: 1B Parameters n1: 01h (Fixed) n2: 00h (Fixed) 00h≤n3≤0Dh, 40h Description Selects the default international character set. n3=00h: U.S.A. (*Manufacturer’s default) n3=01h: France n3=02h: Germany n3=03h: U.K. n3=04h: Denmark I n3=05h: Sweden n3=06h: Italy...
  • Page 104: Esc Ixj1 Retrieve Default International Character Set

    ESC/P Command Reference ESC iXj1 Retrieve default international character set ASCII: Decimal: Hexadecimal: 1B Parameters n1: 00h (Fixed) n2: 00h (Fixed) Description The default international character set setting is returned as 3-byte data. [1] 01h (Fixed) [2] 00h (Fixed) [3] Setting 00h: U.S.A.
  • Page 105: Esc Ixm2 Select Default Character Code Set

    ESC/P Command Reference ESC iXm2 Select default character code set ASCII: Decimal: Hexadecimal: 1B Parameters n1: 01h (Fixed) n2: 00h (Fixed) n3: 00h, 01h, 02h Description Selects the default character code set. n3=00h: Standard character code set (*Manufacturer’s default) n3=01h: Eastern European character code set n3=02h: Western European character code set This command is a static command.
  • Page 106: Appendix A: Character Code Tables

    ESC/P Command Reference Appendix A: Character Code Tables Character code tables (1) Windows1252 (Western Europe) € ° À Ð à ð ‘ ¡ ± Á Ñ á ñ ” ’ ¢ ² Â Ò â ò ƒ “ £ ³ Ã...
  • Page 107 ESC/P Command Reference (2) Windows1250 (Eastern Europe) € tˇ ° Ŕ Đ ŕ đ À ‘ ˇ ± Á Ń á ń " ’ ˘ ˛ Â Ň â ň ˇ “ Ł ł Ă Ó ă ó „ ” ¤...
  • Page 108 ESC/P Command Reference (3) Brother standard Ç É á ░ └ α ü æ í ▒ ┴ β ± ” é Æ ó ▓ ┬ â ô ú │ ├ ¾ ä ö ñ ┤ ─ à ò Ñ ┼...
  • Page 109: International Character Set Table

    ESC/P Command Reference International character set table Corresponding characters that switch in each language when the international character set is changed 23 24 40 5B 5C 5D 5E 60 7B 7C 7D 7E United States (U.S.A) ¦ ˜ France à °...
  • Page 110: Appendix B: Introducing The Brother Developer Center

    ESC/P Command Reference Appendix B: Introducing the Brother Developer Center Useful information for developers, such as applications, tools, SDKs as well as FAQs, are provided in the Brother Developer Center. http://www.brother.com/product/dev/index.htm - 104 - Appendix B: Introducing the Brother Developer Center...

This manual is also suitable for:

Rj-4040

Table of Contents