-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathU_ZPLTypes.pas
More file actions
127 lines (112 loc) · 4.6 KB
/
U_ZPLTypes.pas
File metadata and controls
127 lines (112 loc) · 4.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
unit U_ZPLTypes;
////// https://www.zebra.com/content/dam/zebra/manuals/printers/common/programming/zpl-zbi2-pm-en.pdf
///
interface
const
FieldOrigin = '^FO<LEFT>,<TOP>';
FieldData = '^FD<TEXT>';
FieldSeparator = '^FS';
FontCodeCode = '^A<FONT_NAME><FONT_FIELD_ORIENTATION>,<FONT_CHAR_HEIGHT>,<FONT_WIDTH>';
// <FONT_NAME> = A through Z, and 0 to 9 Any font in the printer
// <CHAR_HEIGHT> = in dots 10 - 32000
// <WIDTH> = in dots 10 - 32000
//GB parameters: Width, Height, Border thickness, line color Black, Corner rounding degree
zplGraphicBox = '^GB<WIDTH>,<HEIGHT>,<BORDERTHICK>,B,0^FS';
zplHorizontalLine = '^GB<WIDTH>,0,<BORDERTHICK>,B,0^FS';
zplVerticalLine = '^GB0,<HEIGHT>,<BORDERTHICK>,B,0^FS';
zplEllipse = '^GE<WIDTH>,<HEIGHT>,<BORDERTHICK>,B^FS';
zplAztecBarCode = '^B0<ORIENTATION>,<MAGNIFICATION>,<EXTENDED_CHANNEL>,<ERROR_AND_SYMBOL_TYPE>,<MENU_INDICATOR>,<NUMBER_OF_SYMBOLS>,<STRUCTURED_APPEND>';
zplCode11BarCode = '^B1<ORIENTATION>,<CHECK_DIGIT>,<HEIGHT>,<SHOW_TEXT>,<SHOW_TEXT_ABOVE>';
zplCode25BarCode = '^B2<ORIENTATION>,<HEIGHT>,<SHOW_TEXT>,<SHOW_TEXT_ABOVE>,<MOD_10_CHECK_DIGIT>';
zplCode39BarCode = '^BY<MODULE_WIDTH>,<WIDTH_RATIO>,<BC_HEIGHT>^B3<ORIENTATION>,<MOD_43_CHECK_DIGIT>,<HEIGHT>,<SHOW_TEXT>,<SHOW_TEXT_ABOVE>';
zplCodeQRBarCode = '^BQ<ORIENTATION>,<MODEL>,<MAGNIFICATION>,<ERROR_CORRECTION>,<MASK_VALUE>';
zplCodeDMBarCode = '^BX<ORIENTATION>,<INDIVIDUAL_HEIGHT>,<QUALITY_LEVEL>,<COLUMNS_TO_ENCODE>,<ROWS_TO_ENCODE>,<FORMAT>,<ESC_SEQ>,<ASPECT_RATIO>';
type
zplOrientation = (zoNormal, zoRotated90, zoInverted180, zoBottomUp); //Default Normal
zplMagnification = (zmFactor1, zmFactor2, zmFactor3, zmFactor4, zmFactor5, zmFactor6, zmFactor7, zmFactor8, zmFactor9, zmFactor10);
zplExtendedChannel = (zeYes, zeNo);
//zplErrorAndSymbolType : 0 = default error correction level
// l01 to 99 = error correction percentage (minimum)
// 101 to 104 = 1 to 4-layer compact symbol
// 201 to 232 = 1 to 32-layer full-range symbol
// 300 = a simple Aztec “Rune”
zplMenuIndicator = (zmYes, zmNo);
//zplNumSymbols = 1 .. 26
zplModel = (zmOriginal, zmEnhaced); //Default zmEnhaced
zplErrCorr = (zeUltraHigh, zeHighReliability, zeStandard, zeHighDensity);
zplMaskValue = (zmValue1, zmValue2, zmValue3, zmValue4, zmValue5, zmValue6, zmValue7);
function GetOrientationChar(zOrientation : zplOrientation) : Char;
function GetModelChar(zModel : zplModel) : Char;
function GetMagnificationStr(zMagnification : zplMagnification) : String;
function getErrCorrChar(zErrCorr : zplErrCorr) : Char;
function getMaskValueChar(zMaskValue : zplMaskValue) : Char;
function getExtendedChannelStr(zExtChannel : zplExtendedChannel) : Char;
function getMenuIndicatorStr(zMenuIndicator : zplMenuIndicator) : Char;
implementation
function GetOrientationChar(zOrientation : zplOrientation) : Char;
begin
case zOrientation of
zoNormal: Result:= 'N';
zoRotated90: Result:= 'R';
zoInverted180: Result:= 'I';
zoBottomUp: Result:= 'B';
end;
end;
function GetModelChar(zModel : zplModel) : Char;
begin
case zModel of
zmOriginal: Result := '1';
zmEnhaced: Result := '2';
end;
end;
function GetMagnificationStr(zMagnification : zplMagnification) : String;
begin
case zMagnification of
zmFactor1: Result := '1';
zmFactor2: Result := '2';
zmFactor3: Result := '3';
zmFactor4: Result := '4';
zmFactor5: Result := '5';
zmFactor6: Result := '6';
zmFactor7: Result := '7';
zmFactor8: Result := '8';
zmFactor9: Result := '9';
zmFactor10: Result := '10';
end;
end;
function getErrCorrChar(zErrCorr : zplErrCorr) : Char;
begin
case zErrCorr of
zeUltraHigh: Result := 'H';
zeHighReliability: Result := 'Q';
zeStandard: Result := 'M';
zeHighDensity: Result := 'L';
end;
end;
function getMaskValueChar(zMaskValue : zplMaskValue) : Char;
begin
case zMaskValue of
zmValue1: Result := '1';
zmValue2: Result := '2';
zmValue3: Result := '3';
zmValue4: Result := '4';
zmValue5: Result := '5';
zmValue6: Result := '6';
zmValue7: Result := '7';
end;
end;
function getExtendedChannelStr(zExtChannel : zplExtendedChannel) : Char;
begin
case zExtChannel of
zeYes: result := 'Y';
zeNo: result := 'N';
end;
end;
function getMenuIndicatorStr(zMenuIndicator : zplMenuIndicator) : Char;
begin
case zMenuIndicator of
zmYes: result := 'Y';
zmNo: result := 'N';
end;
end;
end.