Skip to content

Brother Driver

Michael R Sweet edited this page Mar 23, 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
<0C> Print command (QL-500/550/560/570/580N/650TD/700/1050/1060N)
<1A> Print command with feeding (QL-500/550/560/570/580N/650TD/700/1050/1060N)
<1B> @ Reset (QL-500/550/560/570/580N/650TD/700/1050/1060N)
<1B> i A Set page number for "cut every" (QL-500/550/560/570/580N/650TD/700/1050/1060N)
<1B> i K Set advanced settings (QL-500/550/560/570/580N/650TD/700/1050/1060N)
<1B> i M Set each mode (QL-500/550/560/570/580N/650TD/700/1050/1060N)
<1B> i S Query status (QL-500/550/560/570/580N/650TD/700/1050/1060N)
<1B> i a <01> Set raster command mode (QL-500/550/560/570/580N/650TD/700/1050/1060N/1100/1110NWB/1115NWB)
<1B> i d <n1..2> Set margins (QL-500/550/560/570/580N/650TD/700/1050/1060N)
<1B> i z <n1..10> Set print information (QL-500/550/560/570/580N/650TD/700/1050/1060N)
M Set compression mode (QL-500/550/560/570/580N/650TD/700/1050/1060N)
Z Zero raster graphics (All but QL-800)
g <00> <d1..N> Raster graphics transfer (QL-500/550/560/570/580N/650TD/700/1050/1060N)
w <d1..N> Two-color raster graphics transfer (QL-800/810W/820NWB)
(QL-500/550/560/570/580N/650TD/700/1050/1060N)
(QL-500/550/560/570/580N/650TD/700/1050/1060N)
(QL-500/550/560/570/580N/650TD/700/1050/1060N)
(QL-500/550/560/570/580N/650TD/700/1050/1060N)

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-series)
1 Not used
2 1 = half cut, 0 = full cut (PT-series)
3 1 = cut at end, 0 = no cut
4 1 = special tape being used, 0 = normal tape (PT-series)
5 Not used
6 1 = high resolution, 0 = normal (see below)
7 1 = don't clear expansion buffer, 0 = clear buffer (PT-series)

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-??? 720x360dpi 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 When “auto cut” is specified for QL-560/570/580N/700/1050/1060N, following command (ESC + I + A + {n1}) 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

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> "Raster Graphics Transfer" Command

"n" is the number of bytes, "d1..N" are the bytes for the current line.

Clone this wiki locally