Documentation
¶
Index ¶
- Variables
- type Alignment
- type BarcodeType
- type ErrorStatus
- type Font
- type Printer
- func (p *Printer) Align(align Alignment) error
- func (p *Printer) Barcode(barcode string, format BarcodeType) error
- func (p *Printer) Close() error
- func (p *Printer) Cut() error
- func (p *Printer) End() error
- func (p *Printer) Feed(n int) error
- func (p *Printer) Font(font Font) error
- func (p *Printer) GetErrorStatus() (ErrorStatus, error)
- func (p *Printer) Init() error
- func (p *Printer) Print(data string) error
- func (p *Printer) PrintAreaWidth(width int) error
- func (p *Printer) PrintLn(data string) error
- func (p *Printer) QR(code string, size uint8) error
- func (p *Printer) Size(width, height uint8) error
- func (p *Printer) Smooth(enabled bool) error
- func (p *Printer) Underline(enabled bool) error
- type WindowsPrinter
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorNoDevicesFound = errors.New("No devices found")
Functions ¶
This section is empty.
Types ¶
type BarcodeType ¶
type BarcodeType string
BarcodeType defines the type of barcode
const ( // function type A BarcodeTypeUPCA BarcodeType = "\x00" BarcodeTypeUPCE BarcodeType = "\x01" BarcodeTypeEAN13 BarcodeType = "\x02" BarcodeTypeEAN8 BarcodeType = "\x03" BarcodeTypeCODE39 BarcodeType = "\x04" BarcodeTypeITF BarcodeType = "\x05" BarcodeTypeCODABAR BarcodeType = "\x06" // function type B BarcodeTypeCODE128 BarcodeType = "\x49" )
type ErrorStatus ¶
type ErrorStatus byte
const ( ErrorNone ErrorStatus = 0x00 ErrorCoverOpen ErrorStatus = 0x04 ErrorPaperOut ErrorStatus = 0x20 ErrorGeneric ErrorStatus = 0x40 )
type Printer ¶
type Printer struct {
// contains filtered or unexported fields
}
func NewPrinterByRW ¶
func NewPrinterByRW(rwc io.ReadWriteCloser) (*Printer, error)
func NewUSBPrinterByPath ¶
NewUSBPrinter returns a new printer with a USB Vendor and Product ID if both are 0 it will return the first found Epson POS printer
func NewWindowsPrinterByPath ¶
func (*Printer) Barcode ¶
func (p *Printer) Barcode(barcode string, format BarcodeType) error
Barcode will print a barcode of a specified type as well as the text value
func (*Printer) Close ¶
Close closes the connection to the printer, all commands will not work after this
func (*Printer) GetErrorStatus ¶
func (p *Printer) GetErrorStatus() (ErrorStatus, error)
func (*Printer) PrintAreaWidth ¶
PrintAreaWidth will set the print area width, by default it is the maximum. Eg. 380 is handy for less wide receipts used by card terminals
type WindowsPrinter ¶
type WindowsPrinter struct {
// contains filtered or unexported fields
}
func (WindowsPrinter) Close ¶
func (wprinter WindowsPrinter) Close() error
Click to show internal directories.
Click to hide internal directories.