python-escpos / python-escpos

Python library to manipulate ESC/POS printers
https://python-escpos.readthedocs.io
MIT License
1.04k stars 294 forks source link

Full cut not working on Epson TM-T20III #626

Open stuffmatic opened 9 months ago

stuffmatic commented 9 months ago

I have:

Bug description

I'm using the TM-T20II profile to control my Epson TM T20III (which should be backward compatible with previous TM T20 models according to Epson). Printing seems to work fine but I can't perform full cuts, even though paperFullCut is supported by the TM-T20II profile. This ESC/POS quick reference for the TM T20II and this command documentation also indicate that full cuts are supported. Any help would be greatly appreciated!

Steps to reproduce

from escpos.printer import Usb

vendor_id = 0x04b8
product_id = 0x0e28

p = Usb(vendor_id, product_id, 0, profile="TM-T20II")

# Request a full cut. Results in a partial one
p.text("Hello World\n")
p.cut('FULL')

# Perform the same command with hard coded bytes.
# Also results in a partial cut
GS: bytes = b"\x1d"
_CUT_PAPER = lambda m: GS + b"V" + m
PAPER_FULL_CUT: bytes = _CUT_PAPER(b"\x00")  #: Full cut paper

p.text("Hello World\n")
p.print_and_feed(6)
p._raw(PAPER_FULL_CUT)

p.close()

The result always looks like this, regardless of the requested cut type, whereas I expect the receipts to be cut off completely when requesting a full cut. IMG_7506

Device info

Printer: Epson TM T20III

python-escpos version: 3.1

python version: 3.11.4

operating system: MacOS Sonoma 14.1.1

Edit: The Technical reference guide states that the cutting method is Partial cut (cutting with one point at left uncut). Could this mean that full cut is not supported, even though the command is available?

stuffmatic commented 9 months ago

Looking closer at the command documentation, it states for the TM-T20, TM-T20II and TM-T20III that Only a partial cut (one point left uncut) is available. Therefore the behavior is the same between odd and even parameter m in each ., which is what I'm seeing.

If full cuts are indeed impossible, then perhaps the TM-T20II profile should be updated to reflect that?

belono commented 8 months ago

Hi @stuffmatic and sorry for the late response.

You are right. The command documentation states that only partial cut is supported along the TM-T20 series.

However, the capabilities profile database does not belong to this project, but it does to escpos-printer-db so this issue should be reported to that project.

Would you open a new issue or maybe a PR updating the TM-T20 profile at the escpos-printer-db project?