You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/mailmark.ps.src
+25-13Lines changed: 25 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
% Barcode Writer in Pure PostScript
2
2
% https://bwipp.terryburton.co.uk
3
3
%
4
-
% Copyright (c) 2004-2024 Terry Burton
4
+
% Copyright (c) 2004-2025 Terry Burton
5
5
%
6
6
% $Id$
7
7
%
@@ -45,9 +45,22 @@ dup /parseinput dup /uk.co.terryburton.bwipp findresource put
45
45
dup /renmatrix dup /uk.co.terryburton.bwipp findresource put
46
46
dup /datamatrix dup /uk.co.terryburton.bwipp findresource put
47
47
begin
48
+
49
+
/mailmark.typetoversion <<
50
+
(7) (24x24)
51
+
(9) (32x32)
52
+
(29) (16x48)
53
+
>> readonly def
54
+
55
+
/mailmark.typetoformat <<
56
+
(7) (square)
57
+
(9) (square)
58
+
(29) (rectangle)
59
+
>> readonly def
60
+
48
61
/mailmark {
49
62
50
-
20 dict begin % Confine variables to local scope
63
+
20 dict begin
51
64
52
65
/ctx null def
53
66
/type (unset) def % 7, 9 or 29
@@ -57,7 +70,9 @@ begin
57
70
//processoptions exec /options exch def
58
71
/barcode exch def
59
72
73
+
%
60
74
% Parse ordinals of the form ^NNN to ASCII
75
+
%
61
76
/fncvals <<
62
77
/parse parse
63
78
/parseonly true
@@ -67,31 +82,28 @@ begin
67
82
/barlen barcode length def
68
83
options (parse) undef
69
84
85
+
%
70
86
% Map the given type to a format and version of Data Matrix
87
+
%
71
88
/type load dup (7) ne exch dup (9) ne exch (29) ne and and {
72
89
/bwipp.mailmarkBadType (Royal Mail Mailmark type must be 7, 9 or 29) //raiseerror exec
73
90
} if
74
-
<<
75
-
(7) (24x24)
76
-
(9) (32x32)
77
-
(29) (16x48)
78
-
>> /type load get /version exch def
79
-
80
-
<<
81
-
(7) (square)
82
-
(9) (square)
83
-
(29) (rectangle)
84
-
>> /type load get /format exch def
91
+
//mailmark.typetoversion /type load get /version exch def
92
+
//mailmark.typetoformat /type load get /format exch def
85
93
94
+
%
86
95
% Validate the input
96
+
%
87
97
barcode length 45 lt {
88
98
/bwipp.mailmarkBadLength (Royal Mail Mailmark must contain at least 45 characters of Mailmark formatted data, including any required space padding) //raiseerror exec
89
99
} if
90
100
barcode 0 4 getinterval (JGB ) ne {
91
101
/bwipp.mailmarkBadIndicator (Royal Mail Mailmark must begin with JGB<space> identifier) //raiseerror exec
0 commit comments