garbage after sending image?
See original GitHub issueHi folks, thanks for an awesome project!
I’m new to thermal printers and I’m having a little trouble. It seems like, after I print an image, I get a bunch of garbage characters printed out the next time I try to do anything.
With 2.2.0 (from pypi), if I send text('\n')
after printing an image, I seem to avoid the issue. In master
(3.0a6) that doesn’t help.
I get the same problem even if I use a simple program like this, with an ESC/POS data blob captured from an android esc/pos printer app:
from escpos.printer import Usb
import sys
data = sys.stdin.read()
printer = Usb(0x0416, 0x5011, 0, 0x81, 0x01)
printer._raw(data)
printer.close()
The first time it prints fine, but if I run it again, I see a bit of the image shifted to the right, and then the third time, I get part of the image and garbage. The fourth time, the printout works great, and then the pattern repeats. I could swear it seems like the printer is getting confused, as if it’s missing the end of a command or something. Maybe I’m not doing it right?
Device info
Printer: POS-5890K (this one)
python-escpos version: 2.2.0, 3.0a6
python version: 2.7.14
operating system: Ubuntu 18.04.1
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (1 by maintainers)
Top GitHub Comments
Thanks the issue was due the printer being very old and not supporting new commands, only old ESC commands were supported by the printer
On Mon, 6 Dec 2021 at 9:54 AM Ismael Ittner @.***> wrote:
OMG, I think I found out.
Instead of just
p.image(image)
I didp.image(image, fragment_height=500)
(my image is bigger than 500px in height) and IT WORKED.