Documentation ¶
Index ¶
- Constants
- Variables
- func EncodeMsg(msg string) []byte
- func SubImage(i image.Image, w, h, offsetx, offsety int) image.Image
- func T[K any](c bool, a, b K) K
- func UTF8encode(s string) []byte
- type ImageConverter
- type Printer
- func (p *Printer) Beep(notes ...Sound) (err error)
- func (p *Printer) ClearCanvas(field int) (err error)
- func (p *Printer) DirectImage(i image.Image) (err error)
- func (p *Printer) DirectPRBUF(d []byte) (err error)
- func (p *Printer) LoadImage(name string, i image.Image) (err error)
- func (p *Printer) LoadImageByte(name string, d []byte) (err error)
- func (p *Printer) PF(i uint) (err error)
- func (p *Printer) PRText(txt string) (err error)
- func (printer *Printer) PrintChunked(img image.Image, xoff, yoff int) (err error)
- func (p *Printer) PrintPos(x, y int) (err error)
- func (p *Printer) Read() (res []byte, err error)
- func (p *Printer) ReadResponse() (res *Response, err error)
- func (p *Printer) Send(r io.Reader) (err error)
- func (p *Printer) SendCommand(msg string) (err error)
- func (p *Printer) SendRaw(r io.Reader) (err error)
- func (p *Printer) WriteAll(d []byte) (err error)
- type PrinterConn
- type Resize
- type Response
- type Sound
Constants ¶
View Source
const (
CRLF = "\r\n"
)
View Source
const (
// Port used by most IPL compatible printers
DefaultPort = 9100
)
View Source
const FIXOFFSET = -1
Variables ¶
View Source
var DefaultConverter = &ImageConverter{ Dither: true, Resize: ResizeOff, }
Functions ¶
Types ¶
type ImageConverter ¶
type Printer ¶
type Printer struct { Conn PrinterConn // contains filtered or unexported fields }
func DialPrinter ¶
address has to be specified with port
func OpenPrinter ¶
path should be that of serial device
func (*Printer) ClearCanvas ¶
CLL [<nexp>] if field is -1 (i.e. empty) entire canvas is cleared
func (*Printer) DirectImage ¶
PRBUF<nexp1>[,<nexp2 ]<new line><image data>
func (*Printer) DirectPRBUF ¶
PRBUF<nexp1>[,<nexp2 ]<new line><image data>
func (*Printer) LoadImageByte ¶
only supports PCX images use LoadImage to import *image.Image s
func (*Printer) PrintChunked ¶
func (*Printer) ReadResponse ¶
func (*Printer) SendCommand ¶
type PrinterConn ¶
Click to show internal directories.
Click to hide internal directories.