ptouchgo

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package ptouchgo is a driver for PT-710BT/PT700/PT750W

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompressImage

func CompressImage(data []byte, bytesWidth int) ([]byte, error)

func LoadPNGImage

func LoadPNGImage(r io.Reader, tapeWidth TapeWidth) ([]byte, int, error)

func LoadRawImage

func LoadRawImage(p image.Image, tapeWidth TapeWidth) ([]byte, int, error)

Types

type BatteryStatusType

type BatteryStatusType int

func (BatteryStatusType) String

func (i BatteryStatusType) String() string

type Error1Type

type Error1Type int

type Error2Type

type Error2Type int

func (Error2Type) String

func (i Error2Type) String() string

type FontColor

type FontColor int

func (FontColor) String

func (i FontColor) String() string

type MediaType

type MediaType int

func (MediaType) String

func (i MediaType) String() string

type Model

type Model int

func (Model) String

func (i Model) String() string

type Notification

type Notification int

func (Notification) String

func (i Notification) String() string

type PhaseNumber

type PhaseNumber int

func (PhaseNumber) String

func (i PhaseNumber) String() string

type PhaseTypeNumber

type PhaseTypeNumber int

func (PhaseTypeNumber) String

func (i PhaseTypeNumber) String() string

type Serial

type Serial struct {
	Conn        io.ReadWriteCloser
	TapeWidthMM uint
	Debug       bool
}

func Open

func Open(address string, TapeWidthMM uint, debug bool) (Serial, error)

Open connection, address should be a device path string like "/dev/rfcomm0", "usb" or "usb://0x7c35" or "tcp://192.168.100.1:9100")

func (Serial) ClearBuffer

func (s Serial) ClearBuffer() error

ClearBuffer clears current state If you want to stop ongoing data transfer, send ClearBuffer() and Initialize() then printer buffer are cleared and return to data receiving state

func (Serial) Close

func (s Serial) Close() error

func (Serial) Initialize

func (s Serial) Initialize() error

Initialize clears mode setting

func (Serial) Print

func (s Serial) Print() error

func (Serial) PrintAndEject

func (s Serial) PrintAndEject() error

func (Serial) ReadStatus

func (s Serial) ReadStatus() (*Status, error)

ReadStatus reads current status from buffer

func (Serial) RequestStatus

func (s Serial) RequestStatus() error

RequestStatus requests current status do not use while printing

func (Serial) Reset

func (s Serial) Reset() error

func (Serial) SendImage

func (s Serial) SendImage(tiffdata []byte) error

func (Serial) SetAutocutPerPagesForPTP750W

func (s Serial) SetAutocutPerPagesForPTP750W(pages int) error

func (Serial) SetCompressionModeEnabled

func (s Serial) SetCompressionModeEnabled(enabled bool) error

func (Serial) SetExtendedMode

func (s Serial) SetExtendedMode(pt750halfcut bool, noChainprint bool, specialTapeDisableCut bool, highDPI bool, noClearBuffer bool) error

func (Serial) SetFeedAmount

func (s Serial) SetFeedAmount(amount int) error

func (Serial) SetNotificationMode

func (s Serial) SetNotificationMode(on bool) error

SetNotificationMode set auto status notification mode default: on

func (Serial) SetPrintMode

func (s Serial) SetPrintMode(autocut, mirror bool) error

func (Serial) SetPrintProperty

func (s Serial) SetPrintProperty(rasterLines int) error

func (Serial) SetRasterMode

func (s Serial) SetRasterMode() error

type Status

type Status struct {
	Type         StatusType
	Model        Model
	Battery      BatteryStatusType
	Error1       Error1Type
	Error2       Error2Type
	Mode         int
	StatusType   StatusType
	PhaseType    PhaseTypeNumber
	Phase        PhaseNumber
	Notification Notification

	MediaType  MediaType
	TapeColor  TapeColor
	TapeLength int
	TapeWidth  TapeWidth
	FontColor  FontColor
}

type StatusType

type StatusType int

func (StatusType) String

func (i StatusType) String() string

type TapeColor

type TapeColor int

func (TapeColor) String

func (i TapeColor) String() string

type TapeWidth

type TapeWidth int

func (TapeWidth) String

func (i TapeWidth) String() string

func (TapeWidth) Valid

func (i TapeWidth) Valid() bool

Directories

Path Synopsis
cmd
usb
internal

Jump to

Keyboard shortcuts

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