mirror of
https://github.com/python-escpos/python-escpos
synced 2025-09-13 09:09:58 +00:00
Fix tabs behaviour (#238)
The changes done in this commit should help with the open issues: #5, #27 and #161. The old implementation lacked the NUL char at the end of the command, as defined on the Epson ESC/POS Reference Guide (see https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=53 ). Also, the horizontal tab control character (CTL_HT) shouldn't be there. This implementation allows setting up to 32 tabs with a given tab width. Both values are checked to be in the valid ranges defined on the guide. Also, the TabPosError exception text has been rewritten to define the stated above.
This commit is contained in:
@@ -150,7 +150,8 @@ class CashDrawerError(Error):
|
||||
|
||||
|
||||
class TabPosError(Error):
|
||||
""" Valid tab positions must be in the range 0 to 16.
|
||||
""" Valid tab positions must be set by using from 1 to 32 tabs, and between 1 and 255 tab size values.
|
||||
Both values multiplied must not exceed 255, since it is the maximum tab value.
|
||||
|
||||
This exception is raised by :py:meth:`escpos.escpos.Escpos.control`.
|
||||
The returncode for this exception is `70`.
|
||||
|
Reference in New Issue
Block a user