fix spacing and cut line

This commit is contained in:
Joe Lothan 2026-06-15 18:25:26 -04:00
parent 72b73da310
commit ff248a9b68

View file

@ -14,8 +14,9 @@ import sys
from escpos.printer import Dummy
# TM-T88V: 42 columns at Font A on 80mm paper
LINE_WIDTH = 42
# TM-T88V with 90° rotation: Font A chars are 24 dots wide (instead of 12),
# so 512 printable dots / 24 = 21 chars fit across the 80mm paper width.
LINE_WIDTH = 21
def print_trade(p, symbol, lots, price):
@ -57,6 +58,8 @@ def main():
price = float(price_str)
print_trade(p, symbol, lots, price)
# Feed past the cutter (~20mm above print head, ~12 lines at 12-dot spacing)
p.text("\n" * 16)
p.cut()
with open(output_file, "wb") as f: