Skip to content

Commit

Permalink
Merge branch 'tinygo'
Browse files Browse the repository at this point in the history
  • Loading branch information
meyskens committed Sep 25, 2022
2 parents e3ea418 + ed4ebb9 commit 3ff61a8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions epson.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,19 @@ func (p *Printer) Align(align Alignment) error {
return p.write(fmt.Sprintf("\x1Ba%c", align))
}

// 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
func (p *Printer) PrintAreaWidth(width int) error {
var nh, nl uint8
if width < 256 {
nh = 0
nl = uint8(width)
} else {
nh = uint8(width / 256)
nl = uint8(width % 256)
}
return p.write(fmt.Sprintf("\x1DW%c%c", nl, nh))
}

// Barcode will print a barcode of a specified type as well as the text value
func (p *Printer) Barcode(barcode string, format BarcodeType) error {

Expand Down

0 comments on commit 3ff61a8

Please sign in to comment.