Documentation
¶
Overview ¶
Package brotherql is a Go library and CLI for printing to Brother QL label printers over USB.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrPrinterNotFound = errors.New("brotherql: no Brother QL printer found") ErrInvalidSerial = errors.New("brotherql: invalid serial number") )
Error sentinels for predictable error matching.
var ( Label12 = LabelType{Name: "12", WidthMM: 12, HeightMM: 0, WidthPx: 106, OffsetPx: 29} Label62 = LabelType{Name: "62", WidthMM: 62, HeightMM: 0, WidthPx: 696, OffsetPx: 12} Label62x29 = LabelType{Name: "62x29", WidthMM: 62, HeightMM: 29, WidthPx: 696, OffsetPx: 12} )
Predefined label types supported by QL printers.
Functions ¶
This section is empty.
Types ¶
type Info ¶
type Info struct {
Serial string // printer serial number
Model string // e.g. "QL-700" or "QL-710W"
USBPath string // human-readable USB location
}
Info describes a discovered printer (returned by List, not opened).
type LabelType ¶
type LabelType struct {
Name string // identifier like "62" or "12"
WidthMM int // physical width of the label media in mm
HeightMM int // physical height in mm; 0 indicates continuous tape
WidthPx int // printable dots (brother_ql dots_printable)
OffsetPx int // brother_ql offset_r; left pad (dots) of the emitted raster row
}
LabelType describes a Brother label specification.
type PrintOptions ¶
type PrintOptions struct {
Label LabelType // required: which label media is loaded
Copies int // number of copies; 0 or 1 prints once
AutoCut bool // cut paper after print
HighDPI bool // 600 DPI mode (default 300)
}
PrintOptions configures a single print job.
type Printer ¶
type Printer struct {
// contains filtered or unexported fields
}
Printer represents an open connection to a Brother QL printer. Always Close() when done; defer is recommended.
func Open ¶
Open finds and opens the first connected Brother QL printer over USB. Returns ErrPrinterNotFound if none are connected.
func OpenBySerial ¶
OpenBySerial opens a specific Brother QL printer by serial number. Useful when multiple printers are connected.