From 864dcb81603264ce8d77198ad05850d94e2d43a3 Mon Sep 17 00:00:00 2001 From: TT-392 Date: Wed, 18 Sep 2024 00:11:43 +0200 Subject: [PATCH] Implement hopeful fix for cutting issues --- print.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/print.py b/print.py index f6706bf..53ddcd1 100644 --- a/print.py +++ b/print.py @@ -3,16 +3,21 @@ from format_image import * from PIL import Image import ctypes import io +import time printer = ctypes.CDLL('./epson/library_bridge.so') def print_text(text): + time.sleep(0.1) + try: printer.print_text(b"/dev/usb/lp0", text.encode('utf-8')) except Exception as e: print(f"An error occurred: {e}") def cut_paper(): + time.sleep(0.1) + try: printer.cut(b"/dev/usb/lp0") except Exception as e: @@ -20,6 +25,8 @@ def cut_paper(): def print_image(image): + time.sleep(0.1) + Bytes = io.BytesIO() image.save(Bytes, format='PNG') Bytes = Bytes.getvalue()