pt700

package
v0.0.0-...-797c769 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WidthNoMedia MediaWidth = 0
	Width3_5                = 4
	Width6                  = 6
	Width9                  = 9
	Width12                 = 12
	Width18                 = 18
	Width24                 = 24
)
View Source
const (
	TypeNoMedia      MediaType = 0x00
	TypeLaminated              = 0x01
	TypeNonLaminated           = 0x03
	TypeHeatShrink21           = 0x11
	TypeHeatShrink31           = 0x17
	TypeIncompatible           = 0xFF
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Error1

type Error1 byte
const (
	Err1NoMedia Error1 = 1 << iota

	Err1CutterJam
	Err1WeakBatteries

	Err1HighVoltageAdapter
)

func (Error1) String

func (e Error1) String() string

type Error2

type Error2 byte
const (
	Err2ReplaceMedia Error2 = 1 << iota

	Err2CoverOpen
	Err2Overheating
)

func (Error2) String

func (e Error2) String() string

type MediaType

type MediaType byte

func (MediaType) String

func (t MediaType) String() string

type MediaWidth

type MediaWidth uint8

func (MediaWidth) DPI

func (w MediaWidth) DPI() int

func (MediaWidth) Dx

func (w MediaWidth) Dx() (int, error)

Dx returns the exact width of images that can be printed, in pixels.

func (MediaWidth) MinDy

func (w MediaWidth) MinDy() int

Dy returns the minimum height of images that can be printed, in pixels.

func (MediaWidth) String

func (w MediaWidth) String() string

type PT700

type PT700 int // We have to poll() to read responses, it's easier to use a raw FD.

PT700 controls a Brother PT-700 label printer on Linux through the usblp driver.

func Open

func Open(path string) (PT700, error)

Open opens a PT700 printer. Path should be of the form /dev/usb/lpN.

func (PT700) Close

func (p PT700) Close() error

func (PT700) Print

func (p PT700) Print(imgs ...*monochrome.Image) error

Print the images as pages of one job so the ~24.5mm of blank start tape is only needed once. The images will be individually cut.

func (PT700) Status

func (p PT700) Status() (Status, error)

type PhaseType

type PhaseType uint8
const (
	PhaseEditing PhaseType = iota
	PhasePrinting
)

func (PhaseType) String

func (p PhaseType) String() string

type Status

type Status struct {
	Err1       Error1
	Err2       Error2
	MediaWidth MediaWidth
	MediaType  MediaType
	Type       StatusType
	Phase      PhaseType
}

func (Status) Err

func (s Status) Err() error

Err returns an error representing this status, or nil if there is no error.

type StatusType

type StatusType uint8
const (
	StatusReplyToRequest StatusType = iota
	StatusPrintingCompleted
	StatusErrorOccurred
	StatusExitIFMode
	StatusTurnedOff
	StatusNotification
	StatusPhaseChange
)

func (StatusType) String

func (t StatusType) String() string

Jump to

Keyboard shortcuts

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