Shorten default barcode height -- printer default (~162 dots) prints noticeably tall
deploy / deploy (push) Successful in 10s

This commit is contained in:
randy committed 2026-09-13 12:12:28 +02:00
1 parent d2900361b3
commit f8857384fd
1 file changed
+4 -2
+4 -2
View File
@@ -87,8 +87,10 @@ class ReceiptBuilder
self
end
# Native ESC/POS EAN-13
def ean13(code)
# Native ESC/POS EAN-13. height is in dots (GS h) -- the printer's default
# (~162 dots) prints noticeably tall; 50 is a shorter, still-scannable size.
def ean13(code, height: 50)
@buffer << "\x1D\x68" << height.chr # GS h n -- set barcode height
@buffer << "\x1D\x6B\x02" << code.b << "\x00"
self
end