Skip to content

Brother Driver

Michael R Sweet edited this page Mar 24, 2025 · 17 revisions

This page provides a place to discuss/plan the Brother driver in LPrint.

Files

  • "lprint-brother.c": Driver code
  • "lprint-brother.h": Driver name, make/model, and IEEE-1284 device ID strings

Commands

Command Description
<00> Invalidate (128 or more bytes)
<0C> Print command
<1A> Print command with feeding
<1B> @ Reset
<1B> i A <n> Set page number for "cut every"
<1B> i K <n> Set advanced settings
<1B> i M <n> Set each mode
<1B> i S Query status (all but PT-E550W/PT-P750W)
<1B> i a <01> Set raster command mode
<1B> i d <n1..2> Set margins
<1B> i z <n1..10> Set print information
M <n> Set compression mode
Z Zero raster graphics (all but QL-800)
g <00> <n> <d1..n> Raster graphics transfer (QL-Series)
g <n1..2> <d1..n> Raster graphics transfer (PT-Series)
w <c> <n> <d1..n> Two-color raster graphics transfer (QL-800/810W/820NWB)

ESC i K "Set Advanced Settings" Command

<n> is a single byte whose bits are:

PT-series:

Bit Description
0 1 = draft printing, 0 = normal printing (PT-P900/P900W/P950NW)
1 Not used
2 1 = half cut, 0 = full cut (all but PT-P710BT)
3 1 = cut at end, 0 = no cut
4 1 = special tape being used, 0 = normal tape
5 Not used
6 1 = high resolution, 0 = normal (see below)
7 1 = don't clear expansion buffer, 0 = clear buffer

QL-series;

Bit Description
0 1 = two-color printing, 0 = one-color printing (QL-800/810W/820NWB)
1 Not used
2 Not used
3 1 = cut at end, 0 = no cut
4 Not used
5 Not used
6 1 = high resolution, 0 = normal (see below)
7 Not used

Resolutions:

Model(s) High Normal
PT-E550W/P750W/P710BT 180x360dpi 180dpi
PT-P900/P900W/P950NW 360x720dpi 360dpi
All other PT-series 360dpi 360dpi
QL-570/580N/700/800/810W/820NWB/1100/1110NWB/1115NWB 300x600dpi 300dpi
All other QL-series 300dpi 300dpi

ESC i M "Set Each Mode" Command

Bit 6 Auto cut 1: Auto cut 0:No auto cut Bit 7 Mirror printing 1. Mirror printing 0. No mirror printing (PT-series)

When “auto cut” is specified, the "<1B> i A " command is valid.

ESC i d <n1..2> "Set Margins" Command

n = n1 + 256 * n2

Use 0 for die-cut labels, 35 for continuous tape on QL-550/560/570/580N/700.

ESC i z <n1..10> "Set Print Information" Command

QL-500/550/560/570/580N/650TD/700/1050/1060N:

Specifies the print information.
Definition of {n1} through {n10}
{n1}: Valid flag; specifies which values are valid
#define PI_KIND 0x02 // Paper type
#define PI_WIDTH 0x04 // Paper width
#define PI_LENGTH 0x08 // Paper length
#define PI_QUALITY 0x40 // Give priority to print quality
#define PI_RECOVER 0x80 // Always ON
{n2}: Paper type
Continuous length tape 0A Hex
Die-cut labels 0B Hex
{n3}: Paper width; units: mm
{n4}: Paper length; units: mm
{n5-n8}: Raster number = n8*256*256*256 + n7*256*256 + n6*256 + n5
If the media is not correctly loaded into the printer when the valid flag for PI_KIND,
PI_WIDTH and PI_LENGTH are set to “ON”, an error status is returned (Bit 0 of “error
information 2” is set to “ON”.)
{n9}: Starting page: 0; Other pages: 1
{n10}: Fixed to “0”

QL-1100/1110NWB/1115NWB:

Definitions of {n1} through {n10}
{n1}: Valid flag; Specifies which values are valid
0x02: Media type
0x04: Media width
0x08: Media length
0x40: Priority given to print quality
0x80: Printer recovery always on
{n2}: Media type
Continuous length tape: 0Ah
Die-cut labels: 0Bh
{n3}: {n4}:
{n3}: Media width (mm)
{n4}: Media length (mm)
For the media of width 62 mm × length 100 mm, specify as n3=3Eh and n4=64h.
{n5-n8}: Raster number = n8*256*256*256 + n7*256*256 + n6*256 + n5
If the media is not correctly loaded into the printer when the media type, media width and
media length of valid flag {n1} are set to “ON”, an error status is returned. (Bit 0 of “(2)
Error information 2” is set to “ON”.)
{n9}: Starting page: 0
Other pages: 1
{n10}: Fixed at 0

QL-800/810W/820NWB:

Definitions of {n1} through {n10}
{n1}: Valid flag; Specifies which values are valid
0x02: Media type
0x04: Media width
0x08: Media length
0x40: Priority given to print quality (invalid for two-color printing)
0x80: Printer recovery always on
{n2}: Media type
Continuous length tape: 0Ah
Die-cut labels: 0Bh
{n3}: {n4}:
{n3}: Media width (mm)
{n4}: Media length (mm)
For the media of width 62 mm × length 100 mm, specify as n3=3Eh and n4=64h.
{n5-n8}: Raster number = n8*256*256*256 + n7*256*256 + n6*256 + n5
If the media is not correctly loaded into the printer when the media type, media width and
media length of valid flag {n1} are set to “ON”, an error status is returned. (Bit 0 of “(2)
Error information 2” is set to “ON”.)
* For two-color printing, the raster number is calculated as a single raster data packet
using the following 186 bytes.
‘w’ 01 90 First color data ( 90 b yte s ) ‘w’ 02 90 Second color data ( 9 0 b yt e s)
{n9}: Starting page: 0
Other pages: 1
{n10}: Fixed at 0

PT-E550W/P750W/P710BT:

Definitions of {n1} through {n10}
{n1}: Valid flag; Specifies which values are valid
#define PI_KIND 0x02 // Media type
#define PI_WIDTH 0x04 // Media width
#define PI_LENGTH 0x08 // Media length
#define PI_QUALITY 0x40 // Priority given to print quality(Not used)
#define PI_RECOVER 0x80 // Printer recovery always on
{n2}: Media type
No tape: 00h
Laminated tape: 01h
Non-laminated tape: 03h
Heat-Shrink Tube (HS 2:1): 11h
Heat-Shrink Tube (HS 3:1): 17h
Incompatible tape: FFh
{n3}: {n4}:
{n3}: Media width (mm)
{n4}: Media length (mm)
For the media of width 24 mm, specify as n3=18h and n4=00h.
n4 is normally 00h, regardless of the paper length.
{n5-n8}: Raster number = n8*256*256*256 + n7*256*256 + n6*256 + n5
If the media is not correctly loaded into the printer when the valid flag for PI_KIND,
PI_WIDTH and PI_LENGTH are set to “ON”, an error status is returned (Bit 0 of “(2)
Error information 2” is set to “ON”.)
{n9}: Starting page: 0
Other pages: 1
{n10}: Fixed at 0

PT-H500/P700/E500:

Definitions of {n1} through {n10}
{n1}: Valid flag; Specifies which values are valid
#define PI_KIND 0x02 // Media type
#define PI_WIDTH 0x04 // Media width
#define PI_LENGTH 0x08 // Media length
#define PI_QUALITY 0x40 // Priority given to print quality(Not used)
#define PI_RECOVER 0x80 // Printer recovery always on
{n2}: Media type
No tape: 00h
Laminated tape: 01h
Non-laminated tape: 03h
Heat-Shrink Tube (HS 2:1): 11h
Heat-Shrink Tube (HS 3:1): 17h
Incompatible tape: FFh
{n3}: {n4}:
{n3}: Media width (mm)
{n4}: Media length (mm)
For the media of width 24 mm, specify as n3=18h and n4=00h.
n4 is normally 00h, regardless of the paper length.
{n5-n8}: Raster number = n8*256*256*256 + n7*256*256 + n6*256 + n5
If the media is not correctly loaded into the printer when the valid flag for PI_KIND,
PI_WIDTH and PI_LENGTH are set to “ON”, an error status is returned (Bit 0 of “(2)
Error information 2” is set to “ON”.)
{n9}: Starting page: 0
Other pages: 1
{n10}: Fixed at 0

PT-P900/P900W/P950NW/P910BT:

Definitions of {n1} through {n10}
{n1}: Valid flag: Specifies which values are valid
#define PI_KIND 0x02 // Media type
#define PI_WIDTH 0x04 // Media width
#define PI_LENGTH 0x08 // Media length
#define PI_QUALITY 0x40 // Priority given to print quality (Not used)
#define PI_RECOVER 0x80 // Printer recovery always on
If flag 0x80 is specified…
 PT-P9100/900W/950NW:
Both “Printer recovery” and “bi-directional communication” will be activated.
The printer will send status notification when printing.
 PT-P910BT:
“bi-directional communication” will not be activated.
Please use “Switch automatic status notification mode” command to enable
bi-directional communication with the printer when printing.
{n2}: Media type
Laminated/Non-laminated tape: 00h
Heat-Shrink Tube (HS 2:1): 11h
Heat-Shrink Tube (HS 3:1): 17h
Fle tape: 13h
Incompatible tape: FFh
Note:
 PT-P9100/900W/950NW:
High-resolution printing and draft printing are supported for Laminated tape only.
Please set to 09h when printing.
 PT-P910BT:
High-resolution printing and draft printing are not supported.
{n3}: {n4}:
{n3}: Media width (mm)
{n4}: Media length (mm)
For the media of width 24 mm, specify as n3 = 18h and n4 = 00h.
- 33 -
4. Printing Command Details
Raster Command Reference
n4 is normally 00h, regardless of the paper length.
{n5-n8}: Raster number = n8*256*256*256 + n7*256*256 + n6*256 + n5
If the media is not correctly loaded into the printer when the valid flag for PI_KIND,
PI_WIDTH and PI_LENGTH are set to “ON”, an error status is returned (Bit 0 of “(2) Error
information 2” is set to “ON”.)
{n9}: Starting page: 0
Other pages: 1
Last page: 2
The output will be 2 regardless of starting/last page for the job consists of single page.
{n10}: Fixed at 0

M "Set Compression Mode" Command

"n" is 0 for uncompressed and 2 for PackBits compression.

PackBits is supported by QL-580N/650TD/1050/1060N.

g <00> <d1..n> QL-Series "Raster Graphics Transfer" Command

"d1..n" are the bytes for the current line.

g <n1..2> <d1..n> PT-Series "Raster Graphics Transfer" Command

n = n1 + n2 * 256 (number of bytes)

"d1..n" are the bytes for the current line.

Clone this wiki locally