epson

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package epson implements the protocol used by most thermal printer, also commonly referred to as ESC or POS commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CutPaper

func CutPaper(buf io.Writer)

CutPaper will cut the paper if the printer supports it.

func Image

func Image(buf io.Writer, image image.Image)

Image converts a image to the printer "GS v 0: Print raster image" command and adds it to the printer buffer.

func ImageESCStar added in v1.0.1

func ImageESCStar(buf io.Writer, img image.Image)

ImageESCStar prints using ESC * in 24-dot mode.

func InitPrinter

func InitPrinter(buf io.Writer)

InitPrinter will re-init the printer and aborts any outstanding commands.

func LineBreak

func LineBreak(buf io.Writer)

LineBreak adds a line break to the printer buffer.

func OpenCashDrawer1 added in v1.0.1

func OpenCashDrawer1(buf io.Writer)

OpenCashDrawer1 opens cash drawer connected to pin 2. Uses standard pulse duration (t1=2, t2=5 which is ~100ms on, ~250ms off).

func OpenCashDrawer1WithPulse added in v1.0.1

func OpenCashDrawer1WithPulse(buf io.Writer, t1, t2 byte)

OpenCashDrawer1WithPulse opens cash drawer 1 with custom pulse duration. t1: ON time (0-255, each unit is approximately 50ms) t2: OFF time (0-255, each unit is approximately 50ms)

func OpenCashDrawer2 added in v1.0.1

func OpenCashDrawer2(buf io.Writer)

OpenCashDrawer2 opens cash drawer connected to pin 5. Uses standard pulse duration (t1=2, t2=5 which is ~100ms on, ~250ms off).

func OpenCashDrawer2WithPulse added in v1.0.1

func OpenCashDrawer2WithPulse(buf io.Writer, t1, t2 byte)

OpenCashDrawer2WithPulse opens cash drawer 2 with custom pulse duration. t1: ON time (0-255, each unit is approximately 50ms) t2: OFF time (0-255, each unit is approximately 50ms)

func SetStandardMode

func SetStandardMode(buf io.Writer)

SetStandardMode will set the printer into the standard mode. In this mode the printer will instantly print all data it receives.

Types

This section is empty.

Jump to

Keyboard shortcuts

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