plabel

package
v0.0.0-...-463faf0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PRINTER_P1230PC = 0x59
	PRINTER_H500    = 0x64
	PRINTER_E500    = 0x65
	PRINTER_P700    = 0x67
)
View Source
const (
	VERBOSE_TRACE = 4
	VERBOSE_DEBUG = 3
	VERBOSE_INFO  = 2
	VERBOSE_WARN  = 1

	LOOP_DELAY = 100 //ms

	COMMAND_MODE_ESCP     = 0x00 //ESC/P mode (default)
	COMMAND_MODE_RASTER   = 0x01 //Raster mode
	COMMAND_MODE_TEMPLATE = 0x03 //P-touch Template mode

	PI_KIND    = 0x02 // Media type
	PI_WIDTH   = 0x04 // Media width
	PI_LENGTH  = 0x08 // Media length
	PI_QUALITY = 0x40 // Priority given to print quality(Not used)
	PI_RECOVER = 0x80 // Printer recovery always on

	MEDIA_TYPE_NO_TAPE       = 0x00
	MEDIA_TYPE_LAMINATED     = 0x01
	MEDIA_TYPE_NON_LAMINATED = 0x03
	MEDIA_TYPE_HEAT_SHRINK   = 0x11
	MEDIA_TYPE_INCOMPATIBLE  = 0xff

	DATA_LINE_PIXEL_WIDTH   = 128
	DATA_LINE_BUFFER_LENGTH = 16
)
View Source
const (
	STATUS_PRINTING_COMPLETED = 0x01
	STATUS_ERROR              = 0x02
	STATUS_PHASE_CHANGE       = 0x06

	PHASE_EDITING  = 0x00
	PHASE_PRINTING = 0x01
)

Variables

This section is empty.

Functions

func MediaWidthToMaxPixel

func MediaWidthToMaxPixel(media_width byte, dpi uint16) uint16

Types

type ModelInformation

type ModelInformation struct {
	ModelCode      byte
	IsValid        bool
	ModelName      string
	PixelWidth     uint16
	Resolution     uint16
	UseCompression bool
	MinTapeWidth   byte
	MaxTapeWidth   byte
}

func GetModelInformation

func GetModelInformation(model_code byte) *ModelInformation

func (*ModelInformation) GetModelInformation

func (self *ModelInformation) GetModelInformation(model_code byte) *ModelInformation

type Plabel

type Plabel struct {
	Verbose  byte
	Simulate bool

	PrinterStatus    PrinterStatus
	ModelInformation ModelInformation
	StatusCode       byte
	InitalSettings   bool

	MaxPrintingWidth uint16
	// contains filtered or unexported fields
}

func New

func New() (self *Plabel)

func (*Plabel) Close

func (self *Plabel) Close()

func (*Plabel) DisplayRasterGraphics

func (self *Plabel) DisplayRasterGraphics(raster_data []byte)

func (*Plabel) DisplayStatus

func (self *Plabel) DisplayStatus()

func (*Plabel) DisplayStatusVerbose

func (self *Plabel) DisplayStatusVerbose()

func (*Plabel) Initialize

func (self *Plabel) Initialize()

func (*Plabel) Invalidate

func (self *Plabel) Invalidate()

func (*Plabel) Open

func (self *Plabel) Open(device_path string) bool

func (*Plabel) Print

func (self *Plabel) Print()

func (*Plabel) PrintAndFeed

func (self *Plabel) PrintAndFeed()

func (*Plabel) ProcessStatus

func (self *Plabel) ProcessStatus()

func (*Plabel) RequestStatus

func (self *Plabel) RequestStatus()

func (*Plabel) ResetStatus

func (self *Plabel) ResetStatus()

func (*Plabel) SendCommand

func (self *Plabel) SendCommand(command []byte)

func (*Plabel) SendRasterGraphics

func (self *Plabel) SendRasterGraphics(raster_data []byte)

func (*Plabel) SendRasterGraphicsCompressed

func (self *Plabel) SendRasterGraphicsCompressed(raster_data []byte)

func (*Plabel) SendRasterGraphicsUncompressed

func (self *Plabel) SendRasterGraphicsUncompressed(raster_data []byte)

func (*Plabel) SendZeroRasterGraphics

func (self *Plabel) SendZeroRasterGraphics()

func (*Plabel) SetAdvancedModeSettings

func (self *Plabel) SetAdvancedModeSettings(no_chain_printing bool, special_tape bool, no_buffer_clearing bool)

func (*Plabel) SetCompression

func (self *Plabel) SetCompression()

func (*Plabel) SetCutMirror

func (self *Plabel) SetCutMirror(cut bool, mirror bool)

func (*Plabel) SetFeedMargins

func (self *Plabel) SetFeedMargins(margin_dots uint16)

func (*Plabel) SetPrintInformation

func (self *Plabel) SetPrintInformation(media_type byte, media_width byte, is_starting_page bool, raster_number uint32)

func (*Plabel) ShowInfo

func (self *Plabel) ShowInfo()

func (*Plabel) SwitchDynamicCommandMode

func (self *Plabel) SwitchDynamicCommandMode(mode byte)

func (*Plabel) SwitchEscpMode

func (self *Plabel) SwitchEscpMode()

func (*Plabel) SwitchRasterMode

func (self *Plabel) SwitchRasterMode()

func (*Plabel) TimeMilliseconds

func (self *Plabel) TimeMilliseconds() int64

func (*Plabel) WaitForPrinterStatus

func (self *Plabel) WaitForPrinterStatus(timeout uint16) bool

func (*Plabel) WaitForPrintingCompleted

func (self *Plabel) WaitForPrintingCompleted(timeout uint16) bool

type PrinterStatus

type PrinterStatus struct {
	PrintHeadMark    byte
	Size             byte
	ManufacturerCode byte
	SeriesCode       byte
	ModelCode        byte
	CountryCode      byte
	Reserved1        uint16
	ErrorCode        uint16
	MediaWidth       byte
	MediaType        byte
	Ncol             byte
	Fonts            byte
	JpFonts          byte
	Mode             byte
	Density          byte
	MediaLength      byte
	StatusCode       byte
	PhaseType        byte
	PhaseNumber      uint16
	NotificationCode byte
	ExpansionArea    byte
	TapeColor        byte
	TextColor        byte
	HwSetting        uint32
	Reserved2        uint16
}

func (*PrinterStatus) ErrorDescription

func (self *PrinterStatus) ErrorDescription() (ed string)

func (*PrinterStatus) IsValid

func (self *PrinterStatus) IsValid() bool

func (*PrinterStatus) MediaTypeDescription

func (self *PrinterStatus) MediaTypeDescription() (ed string)

func (*PrinterStatus) NotificationDescription

func (self *PrinterStatus) NotificationDescription() (ed string)

func (*PrinterStatus) PhaseDescription

func (self *PrinterStatus) PhaseDescription() (ed string)

func (*PrinterStatus) PhaseTypeDescription

func (self *PrinterStatus) PhaseTypeDescription() (ed string)

func (*PrinterStatus) StatusDescription

func (self *PrinterStatus) StatusDescription() (ed string)

func (*PrinterStatus) TapeColorDescription

func (self *PrinterStatus) TapeColorDescription() (ed string)

func (*PrinterStatus) TextColorDescription

func (self *PrinterStatus) TextColorDescription() (ed string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL