Skip to content

Constants & enums

Command-set constants and the enums used for formatting, barcodes, code pages, character sets, LED modes and status types.

vkp80iii.constants

Enumerations and named constants for the VKP80III command set.

Values are the raw bytes the printer expects, so an :class:enum.IntEnum member can be passed straight through to the command builders.

Justify

Bases: IntEnum

Horizontal justification (ESC a).

Source code in src/vkp80iii/constants.py
28
29
30
31
32
33
class Justify(IntEnum):
    """Horizontal justification (ESC a)."""

    LEFT = 0
    CENTER = 1
    RIGHT = 2

Font

Bases: IntEnum

Character font (ESC M / FS %).

Source code in src/vkp80iii/constants.py
36
37
38
39
40
class Font(IntEnum):
    """Character font (ESC M / FS %)."""

    A = 0  # 12x24, ~42 columns on 72 mm
    B = 1  # 9x17, ~56 columns

Underline

Bases: IntEnum

Underline thickness (ESC -).

Source code in src/vkp80iii/constants.py
43
44
45
46
47
48
class Underline(IntEnum):
    """Underline thickness (ESC -)."""

    NONE = 0
    SINGLE = 1
    DOUBLE = 2

PrintQuality

Bases: IntEnum

Print quality / speed (GS F0, command 0x1D 0xF0).

Source code in src/vkp80iii/constants.py
51
52
53
54
55
56
class PrintQuality(IntEnum):
    """Print quality / speed (GS F0, command 0x1D 0xF0)."""

    HIGH_QUALITY = 0
    NORMAL = 1
    HIGH_SPEED = 2

Barcode

Bases: IntEnum

1D barcode symbologies for :func:~vkp80iii.commands.barcode.

These are the "format 2" selectors (length-prefixed form, GS k m n d1..dn), which the library uses because it can carry the full byte range and an explicit length.

Source code in src/vkp80iii/constants.py
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
class Barcode(IntEnum):
    """1D barcode symbologies for :func:`~vkp80iii.commands.barcode`.

    These are the "format 2" selectors (length-prefixed form, ``GS k m n
    d1..dn``), which the library uses because it can carry the full byte
    range and an explicit length.
    """

    UPC_A = 0x41
    UPC_E = 0x42
    EAN13 = 0x43
    EAN8 = 0x44
    CODE39 = 0x45
    ITF = 0x46
    CODABAR = 0x47
    CODE93 = 0x48
    CODE128 = 0x49
    CODE32 = 0x5A

HRIPosition

Bases: IntEnum

Human-readable interpretation text position (GS H).

Source code in src/vkp80iii/constants.py
80
81
82
83
84
85
86
class HRIPosition(IntEnum):
    """Human-readable interpretation text position (GS H)."""

    NONE = 0
    ABOVE = 1
    BELOW = 2
    BOTH = 3

HRIFont

Bases: IntEnum

Font for HRI characters (GS f).

Source code in src/vkp80iii/constants.py
89
90
91
92
93
class HRIFont(IntEnum):
    """Font for HRI characters (GS f)."""

    A = 0
    B = 1

QRModel

Bases: IntEnum

QR Code model (GS ( k fn=165).

Source code in src/vkp80iii/constants.py
 97
 98
 99
100
101
class QRModel(IntEnum):
    """QR Code model (GS ( k fn=165)."""

    MODEL2 = 0x32
    MICRO = 0x33

QRErrorCorrection

Bases: IntEnum

QR error-correction level (GS ( k fn=169).

Source code in src/vkp80iii/constants.py
104
105
106
107
108
109
110
111
class QRErrorCorrection(IntEnum):
    """QR error-correction level (GS ( k fn=169)."""

    AUTO = 0x30
    L = 0x31  # ~7%
    M = 0x32  # ~15%
    Q = 0x33  # ~25%
    H = 0x34  # ~30%

PDF417ErrorMode

Bases: IntEnum

PDF417 ECC selection mode (GS ( k fn=069).

Source code in src/vkp80iii/constants.py
114
115
116
117
118
class PDF417ErrorMode(IntEnum):
    """PDF417 ECC selection mode (GS ( k fn=069)."""

    LEVEL = 0x30  # fixed level 0..8
    RATIO = 0x31  # n x 10% of data

AztecType

Bases: IntEnum

AZTEC symbol type (GS ( k fn=P65).

Source code in src/vkp80iii/constants.py
121
122
123
124
125
class AztecType(IntEnum):
    """AZTEC symbol type (GS ( k fn=P65)."""

    FULL = 0x00
    RUNE = 0x01

DataMatrixEncoding

Bases: IntEnum

DataMatrix encoding scheme (GS ( k fn=Q65).

Source code in src/vkp80iii/constants.py
128
129
130
131
132
133
134
135
136
137
class DataMatrixEncoding(IntEnum):
    """DataMatrix encoding scheme (GS ( k fn=Q65)."""

    ASCII = 0x00
    C40 = 0x01
    TEXT = 0x02
    X12 = 0x03
    EDIFACT = 0x04
    BASE256 = 0x05
    AUTO = 0x06

CharsetCountry

Bases: IntEnum

International character set (ESC R). Common subset.

Source code in src/vkp80iii/constants.py
141
142
143
144
145
146
147
148
149
150
151
152
153
154
class CharsetCountry(IntEnum):
    """International character set (ESC R). Common subset."""

    USA = 0
    FRANCE = 1
    GERMANY = 2
    UK = 3
    DENMARK_I = 4
    SWEDEN = 5
    ITALY = 6
    SPAIN_I = 7
    JAPAN = 8
    NORWAY = 9
    DENMARK_II = 10

CodePage

Bases: IntEnum

Character code table (ESC t). Common subset of the supported pages.

The full set depends on the code pages installed on the device; selecting a missing page leaves the current one in use.

Source code in src/vkp80iii/constants.py
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
class CodePage(IntEnum):
    """Character code table (ESC t). Common subset of the supported pages.

    The full set depends on the code pages installed on the device; selecting
    a missing page leaves the current one in use.
    """

    PC437 = 0  # USA / Standard Europe
    KATAKANA = 1
    PC850 = 2  # Multilingual
    PC860 = 3  # Portuguese
    PC863 = 4  # Canadian-French
    PC865 = 5  # Nordic
    WPC1252 = 16  # Windows Latin-1
    PC866 = 17  # Cyrillic
    PC852 = 18  # Latin-2
    PC858 = 19  # Euro

StatusType

Bases: IntEnum

Argument n for the real-time status request (DLE EOT n).

Source code in src/vkp80iii/constants.py
177
178
179
180
181
182
183
184
class StatusType(IntEnum):
    """Argument ``n`` for the real-time status request (DLE EOT n)."""

    PRINTER = 1
    OFFLINE = 2
    ERROR = 3
    PAPER = 4
    PRESENTER = 5  # ticket in output / presenter sensors

LedMode

Bases: IntEnum

Bezel RGB LED bar mode (FS B, 0x1C 0x42).

Source code in src/vkp80iii/constants.py
188
189
190
191
192
193
194
class LedMode(IntEnum):
    """Bezel RGB LED bar mode (FS B, 0x1C 0x42)."""

    OFF = 0x43  # 'C'
    FLASH = 0x46  # 'F' (needs a frequency byte)
    RESET = 0x52  # 'R'
    ON = 0x53  # 'S' steady

LedFlashFreq

Bases: IntEnum

Flash frequency for :data:LedMode.FLASH.

Source code in src/vkp80iii/constants.py
197
198
199
200
201
202
203
204
205
206
207
208
209
class LedFlashFreq(IntEnum):
    """Flash frequency for :data:`LedMode.FLASH`."""

    HZ_0_25 = 0x01
    HZ_0_5 = 0x02
    HZ_1 = 0x03
    HZ_2 = 0x04
    HZ_3 = 0x05
    HZ_4 = 0x06
    HZ_5 = 0x07
    HZ_6 = 0x08
    HZ_8 = 0x09
    HZ_12 = 0x0A