Subversion Repositories Scribus

Rev

Rev 25090 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
18800 fschmid 1
%!PS
19685 fschmid 2
 
25125 craig 3
% Barcode Writer in Pure PostScript - Version 2022-07-29
22439 craig 4
% https://bwipp.terryburton.co.uk
4460 subik 5
%
25039 craig 6
% Copyright (c) 2004-2022 Terry Burton
4460 subik 7
%
8
% Permission is hereby granted, free of charge, to any
9
% person obtaining a copy of this software and associated
10
% documentation files (the "Software"), to deal in the
11
% Software without restriction, including without
12
% limitation the rights to use, copy, modify, merge,
13
% publish, distribute, sublicense, and/or sell copies of
14
% the Software, and to permit persons to whom the Software
15
% is furnished to do so, subject to the following
16
% conditions:
17
%
18
% The above copyright notice and this permission notice
19
% shall be included in all copies or substantial portions
20
% of the Software.
21
%
22
% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
23
% KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
24
% THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
25
% PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26
% THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
27
% DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
28
% CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29
% CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
30
% IN THE SOFTWARE.
31
 
32
% --BEGIN TEMPLATE--
33
 
18800 fschmid 34
% --BEGIN RESOURCE preamble--
25125 craig 35
%%BeginResource: Category uk.co.terryburton.bwipp 0.0 2022072900 29629 32838
18800 fschmid 36
%%BeginData:          6 ASCII Lines
16255 fschmid 37
currentglobal
38
true setglobal
18800 fschmid 39
/Generic /Category findresource dup length 1 add dict copy dup
40
/InstanceType /setpacking where {pop /packedarraytype} {/arraytype} ifelse put
16255 fschmid 41
/uk.co.terryburton.bwipp exch /Category defineresource pop
42
setglobal
18800 fschmid 43
%%EndData
44
%%EndResource
45
% --END RESOURCE preamble--
16255 fschmid 46
 
25125 craig 47
% --BEGIN RESOURCE loadctx--
48
% --REQUIRES preamble--
49
%%BeginResource: uk.co.terryburton.bwipp loadctx 0.0 2022072900 40205 39999
50
%%BeginData:         25 ASCII Lines
51
/setpacking where {pop currentpacking true setpacking} if
52
1 dict
53
begin
54
/loadctx {
55
    % Place a context dictionary just below the current dictionary, which can
56
    % be populated with static data on the first run and then carried between
57
    % invocations of the encoder
58
    /ctxname exch def
59
    ctx null ne {
60
        ctx ctxname known not {
61
            ctx ctxname 10 dict put
62
            /ctxdef {ctx ctxname get begin exec end} def
63
        } {
64
            /ctxdef {pop} def  % No need to redefine within the existing context
65
        } ifelse
66
        currentdict ctx ctxname get end begin begin
67
    } {
68
        /ctxdef {exec} def  % No context provided, so define ephemerally
69
    } ifelse
70
}
71
[/barcode] {null def} forall
72
bind def
73
/loadctx dup load /uk.co.terryburton.bwipp defineresource pop
74
end
75
/setpacking where {pop setpacking} if
76
%%EndData
77
%%EndResource
78
% --END RESOURCE loadctx--
79
 
80
% --BEGIN RESOURCE unloadctx--
81
% --REQUIRES preamble--
82
%%BeginResource: uk.co.terryburton.bwipp unloadctx 0.0 2022072900 38856 38677
83
%%BeginData:         14 ASCII Lines
84
/setpacking where {pop currentpacking true setpacking} if
85
1 dict
86
begin
87
/unloadctx {
88
    % Remove the context which is expected to be just underneath currentdict
89
    ctx null ne {
90
        currentdict end end begin
91
    } if
92
}
93
[/barcode] {null def} forall
94
bind def
95
/unloadctx dup load /uk.co.terryburton.bwipp defineresource pop
96
end
97
/setpacking where {pop setpacking} if
98
%%EndData
99
%%EndResource
100
% --END RESOURCE unloadctx--
101
 
18800 fschmid 102
% --BEGIN RESOURCE raiseerror--
103
% --REQUIRES preamble--
25125 craig 104
%%BeginResource: uk.co.terryburton.bwipp raiseerror 0.0 2022072900 39029 38860
25039 craig 105
%%BeginData:         15 ASCII Lines
18800 fschmid 106
/setpacking where {pop currentpacking true setpacking} if
25125 craig 107
10 dict
18800 fschmid 108
begin
109
/raiseerror {
25125 craig 110
    $error exch /errorinfo exch put
111
    $error exch /errorname exch put
112
    $error /command null put
113
    $error /newerror true put
114
    stop
25039 craig 115
}
116
[/barcode] {null def} forall
117
bind def
18800 fschmid 118
/raiseerror dup load /uk.co.terryburton.bwipp defineresource pop
119
end
120
/setpacking where {pop setpacking} if
121
%%EndData
122
%%EndResource
123
% --END RESOURCE raiseerror--
124
 
25039 craig 125
% --BEGIN RESOURCE parseinput--
25125 craig 126
% --REQUIRES preamble loadctx unloadctx raiseerror--
127
%%BeginResource: uk.co.terryburton.bwipp parseinput 0.0 2022072900 73481 69190
128
%%BeginData:        174 ASCII Lines
25039 craig 129
/setpacking where {pop currentpacking true setpacking} if
25125 craig 130
10 dict
131
dup /loadctx dup /uk.co.terryburton.bwipp findresource put
132
dup /unloadctx dup /uk.co.terryburton.bwipp findresource put
25039 craig 133
dup /raiseerror dup /uk.co.terryburton.bwipp findresource put
134
begin
135
/parseinput {
136
 
25125 craig 137
    20 dict begin
25039 craig 138
 
25125 craig 139
    /parseinput //loadctx exec
140
 
25039 craig 141
    /fncvals exch def
142
    /barcode exch def
143
 
144
    /parse     dup dup fncvals exch get def fncvals exch undef
145
    /parsefnc  dup dup fncvals exch get def fncvals exch undef
146
    /parseonly dup dup fncvals exch known def fncvals exch undef
147
    /eci       dup dup fncvals exch known def fncvals exch undef
148
 
25125 craig 149
    % Control character names to ordinals
150
{
151
    <<
152
        [
153
            /NUL /SOH /STX /ETX /EOT /ENQ /ACK /BEL
154
            /BS  /TAB /LF  /VT  /FF  /CR  ()   ()    % SO and SI prefix clash with SOH
155
            /DLE /DC1 /DC2 /DC3 /DC4 /NAK /SYN /ETB
156
            /CAN /EM  /SUB /ESC /FS  /GS  /RS  /US
157
        ]
158
 
159
            1 index 1 add 3 1 roll exch 3 -1 roll
160
        } forall pop
161
    >> /ctrl exch def
162
} ctxdef
163
 
25039 craig 164
    /msg barcode length array def
165
    /j 0 def
166
    barcode {  % loop
167
        (^) search exch
168
        % Copy characters up to a "^"
169
        dup length exch
170
        msg exch j exch [ exch {} forall ] putinterval
171
        j add /j exch def
172
        {  % Found a "^" escape character
173
            pop
174
            1 {  % common exit
175
 
176
                parse not parsefnc not and {  % "^" as is
177
                    msg j 94 put
178
                    /j j 1 add def
179
                    exit
180
                } if
181
 
182
                % Encode "^" to start with
183
                msg j 94 put
184
                /j j 1 add def
185
 
186
                % parse
187
                parse {
25125 craig 188
                    dup length 3 ge {  % "^XXX" byte
189
                        dup 0 3 getinterval ctrl exch
190
                        2 copy known {
191
                            /j j 1 sub def  % Replace "^" with ordinal
192
                            get msg exch j exch put
193
                            /j j 1 add def
194
                            dup length 3 sub 3 exch getinterval
195
                            exit
196
                        } {
197
                            pop pop
198
                        } ifelse
199
                    } if
200
                    dup length 2 ge {  % "^XX" to byte
201
                        dup 0 2 getinterval ctrl exch
202
                        2 copy known {
203
                            /j j 1 sub def  % Replace "^" with ordinal
204
                            get msg exch j exch put
205
                            /j j 1 add def
206
                            dup length 2 sub 2 exch getinterval
207
                            exit
208
                        } {
209
                            pop pop
210
                        } ifelse
211
                    } if
212
                    dup length 3 ge {  % "^NNN" to byte
25039 craig 213
                        dup 0 3 getinterval true exch {
214
                            dup 48 lt exch 57 gt or { pop false } if
215
                        } forall
25125 craig 216
                        {
25039 craig 217
                            dup 0 3 getinterval cvi dup 255 gt {
218
                                pop pop
219
                                /bwipp.invalidOrdinal (Ordinal must be 000 to 255) //raiseerror exec
220
                            } if
221
                            /j j 1 sub def  % Replace "^" with ordinal
222
                            msg exch j exch put
223
                            /j j 1 add def
224
                            dup length 3 sub 3 exch getinterval
225
                        } if
226
                    } if
227
                } if
228
 
229
                parseonly
230
                parsefnc not or
231
                msg j 1 sub get 94 ne  % Carat was substituted away
232
                or {exit} if
233
 
234
                % parsefnc
235
                /j j 1 sub def
236
                dup length 3 lt {
237
                    pop
238
                    /bwipp.truncatedFNC (Function character truncated) //raiseerror exec
239
                } if
240
                dup 0 get 94 eq {  % "^^" -> "^"
241
                    msg j 94 put
242
                    /j j 1 add def
243
                    dup length 1 sub 1 exch getinterval
244
                    exit
245
                } if
246
                dup 0 3 getinterval (ECI) eq eci and {  % "^ECInnnnnn" -> -1nnnnnn
247
                    dup length 9 lt {
248
                        pop
249
                        /bwipp.truncatedECI (ECI truncated) //raiseerror exec
250
                    } if
251
                    dup 3 6 getinterval
252
                    dup {
253
                        dup 48 lt exch 57 gt or {
254
                            pop pop
255
                            /bwipp.invalidECI (ECI must be 000000 to 999999) //raiseerror exec
256
                        } if
257
                    } forall
258
 
259
                    msg exch j exch put
260
                    /j j 1 add def
261
                    dup length 9 sub 9 exch getinterval
262
                    exit
263
                } if
264
                dup length 4 lt {  % "^FNCx" -> fncvals{FNCx}
265
                    pop
266
                    /bwipp.truncatedFNC (Function character truncated) //raiseerror exec
267
                } if
268
                dup 0 4 getinterval dup fncvals exch known not {
269
                    dup length 28 add string dup 28 4 -1 roll putinterval
270
                    dup 0 (Unknown function character: ) putinterval
271
                    exch pop
272
                    /bwipp.unknownFNC exch //raiseerror exec
273
                } if
274
                fncvals exch get
275
                msg exch j exch put
276
                /j j 1 add def
277
                dup length 4 sub 4 exch getinterval
278
                exit
279
 
280
            } repeat
281
        } {  % No more "^" characters
282
            exit
283
        }  ifelse
284
    } loop
285
 
286
    parseonly not {
287
        msg 0 j getinterval
288
    } {
289
        j string
290
 
291
    } ifelse
292
 
25125 craig 293
    //unloadctx exec
294
 
25039 craig 295
    end
296
 
297
}
298
[/barcode] {null def} forall
299
bind def
300
/parseinput dup load /uk.co.terryburton.bwipp defineresource pop
301
end
302
/setpacking where {pop setpacking} if
303
%%EndData
304
%%EndResource
305
% --END RESOURCE parseinput--
306
 
25125 craig 307
% --BEGIN RESOURCE gs1process--
308
% --REQUIRES preamble loadctx unloadctx parseinput raiseerror--
309
%%BeginResource: uk.co.terryburton.bwipp gs1process 0.0 2022072900 564308 592071
310
%%BeginData:       2899 ASCII Lines
25039 craig 311
/setpacking where {pop currentpacking true setpacking} if
25125 craig 312
10 dict
313
dup /loadctx dup /uk.co.terryburton.bwipp findresource put
314
dup /unloadctx dup /uk.co.terryburton.bwipp findresource put
315
dup /parseinput dup /uk.co.terryburton.bwipp findresource put
25039 craig 316
dup /raiseerror dup /uk.co.terryburton.bwipp findresource put
317
begin
25125 craig 318
/gs1process {
25039 craig 319
 
320
    20 dict begin
321
 
25125 craig 322
    /gs1process //loadctx exec
25039 craig 323
 
25125 craig 324
{
325
    % Extracted from the GS1 Syntax Dictionary
25039 craig 326
    /gs1syntax <<
327
 
25125 craig 328
        <<
329
            /parts  [
330
                << /cset /N  /min 18  /max 18  /opt false  /linters [ /lintcsum /lintkey ] >>
331
            ]
332
            /dlpkey [ ]
333
        >>
25039 craig 334
        (00) exch dup
335
        pop
336
 
25125 craig 337
        <<
338
            /parts  [
339
                << /cset /N  /min 14  /max 14  /opt false  /linters [ /lintcsum /lintkey ] >>
340
            ]
341
            /ex     [ (02) (255) (37) ]
342
            /dlpkey [ [ (22) (10) (21) ] [ (235) ] ]
343
        >>
25039 craig 344
        (01) exch dup
25125 craig 345
        pop
346
 
347
        <<
348
            /parts  [
349
                << /cset /N  /min 14  /max 14  /opt false  /linters [ /lintcsum /lintkey ] >>
350
            ]
351
            /req    [ [ (37) ] ]
352
        >>
25039 craig 353
        (02) exch dup
354
        pop
355
 
25125 craig 356
        <<
357
            /parts  [
358
                << /cset /X  /min  1  /max 20  /opt false  /linters [] >>
359
            ]
360
            /req    [ [ (01) (02) (8006) (8026) ] ]
361
        >>
25039 craig 362
        (10) exch dup
363
        pop
364
 
25125 craig 365
        <<
366
            /parts  [
367
                << /cset /N  /min  6  /max  6  /opt false  /linters [ /lintyymmd0 ] >>
368
            ]
369
            /req    [ [ (01) (02) (8006) (8026) ] ]
370
        >>
25039 craig 371
        (11) exch dup
25125 craig 372
        pop
373
 
374
        <<
375
            /parts  [
376
                << /cset /N  /min  6  /max  6  /opt false  /linters [ /lintyymmd0 ] >>
377
            ]
378
            /req    [ [ (8020) ] ]
379
        >>
25039 craig 380
        (12) exch dup
25125 craig 381
        pop
382
 
383
        <<
384
            /parts  [
385
                << /cset /N  /min  6  /max  6  /opt false  /linters [ /lintyymmd0 ] >>
386
            ]
387
            /req    [ [ (01) (02) (8006) (8026) ] ]
388
        >>
25039 craig 389
        (13) exch dup
390
        (15) exch dup
391
        (16) exch dup
25125 craig 392
        pop
393
 
394
        <<
395
            /parts  [
396
                << /cset /N  /min  6  /max  6  /opt false  /linters [ /lintyymmd0 ] >>
397
            ]
398
            /req    [ [ (01) (02) (255) (8006) (8026) ] ]
399
        >>
25039 craig 400
        (17) exch dup
401
        pop
402
 
25125 craig 403
        <<
404
            /parts  [
405
                << /cset /N  /min  2  /max  2  /opt false  /linters [] >>
406
            ]
407
            /req    [ [ (01) (02) (8006) (8026) ] ]
408
        >>
25039 craig 409
        (20) exch dup
410
        pop
411
 
25125 craig 412
        <<
413
            /parts  [
414
                << /cset /X  /min  1  /max 20  /opt false  /linters [] >>
415
            ]
416
            /ex     [ (235) ]
417
            /req    [ [ (01) (8006) ] ]
418
        >>
25039 craig 419
        (21) exch dup
25125 craig 420
        pop
421
 
422
        <<
423
            /parts  [
424
                << /cset /X  /min  1  /max 20  /opt false  /linters [] >>
425
            ]
426
            /req    [ [ (01) ] ]
427
        >>
25039 craig 428
        (22) exch dup
429
        pop
430
 
25125 craig 431
        <<
432
            /parts  [
433
                << /cset /X  /min  1  /max 28  /opt false  /linters [] >>
434
            ]
435
            /req    [ [ (01) ] ]
436
        >>
25039 craig 437
        (235) exch dup
438
        pop
439
 
25125 craig 440
        <<
441
            /parts  [
442
                << /cset /X  /min  1  /max 30  /opt false  /linters [] >>
443
            ]
444
            /req    [ [ (01) (02) (8006) (8026) ] ]
445
        >>
25039 craig 446
        (240) exch dup
447
        (241) exch dup
448
        pop
449
 
25125 craig 450
        <<
451
            /parts  [
452
                << /cset /N  /min  1  /max  6  /opt false  /linters [] >>
453
            ]
454
            /req    [ [ (01) (02) (8006) (8026) ] ]
455
        >>
25039 craig 456
        (242) exch dup
457
        pop
458
 
25125 craig 459
        <<
460
            /parts  [
461
                << /cset /X  /min  1  /max 20  /opt false  /linters [] >>
462
            ]
463
            /req    [ [ (01) ] ]
464
        >>
25039 craig 465
        (243) exch dup
466
        pop
467
 
25125 craig 468
        <<
469
            /parts  [
470
                << /cset /X  /min  1  /max 30  /opt false  /linters [] >>
471
            ]
472
            /req    [ [ (01) (8006) ] [ (21) ] ]
473
        >>
25039 craig 474
        (250) exch dup
25125 craig 475
        pop
476
 
477
        <<
478
            /parts  [
479
                << /cset /X  /min  1  /max 30  /opt false  /linters [] >>
480
            ]
481
            /req    [ [ (01) (8006) ] ]
482
        >>
25039 craig 483
        (251) exch dup
484
        pop
485
 
25125 craig 486
        <<
487
            /parts  [
488
                << /cset /N  /min 13  /max 13  /opt false  /linters [ /lintcsum /lintkey ] >>
489
                << /cset /X  /min  1  /max 17  /opt true   /linters [] >>
490
            ]
491
            /dlpkey [ ]
492
        >>
25039 craig 493
        (253) exch dup
494
        pop
495
 
25125 craig 496
        <<
497
            /parts  [
498
                << /cset /X  /min  1  /max 20  /opt false  /linters [] >>
499
            ]
500
            /req    [ [ (414) ] ]
501
        >>
25039 craig 502
        (254) exch dup
503
        pop
504
 
25125 craig 505
        <<
506
            /parts  [
507
                << /cset /N  /min 13  /max 13  /opt false  /linters [ /lintcsum /lintkey ] >>
508
                << /cset /N  /min  1  /max 12  /opt true   /linters [] >>
509
            ]
510
            /ex     [ (01) (02) (415) (8006) (8020) (8026) ]
511
            /dlpkey [ ]
512
        >>
25039 craig 513
        (255) exch dup
514
        pop
515
 
25125 craig 516
        <<
517
            /parts  [
518
                << /cset /N  /min  1  /max  8  /opt false  /linters [] >>
519
            ]
520
            /req    [ [ (01) (02) ] ]
521
        >>
25039 craig 522
        (30) exch dup
523
        pop
524
 
25125 craig 525
        <<
526
            /parts  [
527
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
528
            ]
529
            /ex     [ (310n) ]
530
            /req    [ [ (01) (02) ] ]
531
        >>
25039 craig 532
        (3100) exch dup
533
        (3101) exch dup
534
        (3102) exch dup
535
        (3103) exch dup
536
        (3104) exch dup
537
        (3105) exch dup
25125 craig 538
        pop
539
 
540
        <<
541
            /parts  [
542
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
543
            ]
544
            /ex     [ (311n) ]
545
            /req    [ [ (01) (02) ] ]
546
        >>
25039 craig 547
        (3110) exch dup
548
        (3111) exch dup
549
        (3112) exch dup
550
        (3113) exch dup
551
        (3114) exch dup
552
        (3115) exch dup
25125 craig 553
        pop
554
 
555
        <<
556
            /parts  [
557
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
558
            ]
559
            /ex     [ (312n) ]
560
            /req    [ [ (01) (02) ] ]
561
        >>
25039 craig 562
        (3120) exch dup
563
        (3121) exch dup
564
        (3122) exch dup
565
        (3123) exch dup
566
        (3124) exch dup
567
        (3125) exch dup
25125 craig 568
        pop
569
 
570
        <<
571
            /parts  [
572
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
573
            ]
574
            /ex     [ (313n) ]
575
            /req    [ [ (01) (02) ] ]
576
        >>
25039 craig 577
        (3130) exch dup
578
        (3131) exch dup
579
        (3132) exch dup
580
        (3133) exch dup
581
        (3134) exch dup
582
        (3135) exch dup
25125 craig 583
        pop
584
 
585
        <<
586
            /parts  [
587
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
588
            ]
589
            /ex     [ (314n) ]
590
            /req    [ [ (01) (02) ] ]
591
        >>
25039 craig 592
        (3140) exch dup
593
        (3141) exch dup
594
        (3142) exch dup
595
        (3143) exch dup
596
        (3144) exch dup
597
        (3145) exch dup
25125 craig 598
        pop
599
 
600
        <<
601
            /parts  [
602
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
603
            ]
604
            /ex     [ (315n) ]
605
            /req    [ [ (01) (02) ] ]
606
        >>
25039 craig 607
        (3150) exch dup
608
        (3151) exch dup
609
        (3152) exch dup
610
        (3153) exch dup
611
        (3154) exch dup
612
        (3155) exch dup
25125 craig 613
        pop
614
 
615
        <<
616
            /parts  [
617
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
618
            ]
619
            /ex     [ (316n) ]
620
            /req    [ [ (01) (02) ] ]
621
        >>
25039 craig 622
        (3160) exch dup
623
        (3161) exch dup
624
        (3162) exch dup
625
        (3163) exch dup
626
        (3164) exch dup
627
        (3165) exch dup
25125 craig 628
        pop
629
 
630
        <<
631
            /parts  [
632
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
633
            ]
634
            /ex     [ (320n) ]
635
            /req    [ [ (01) (02) ] ]
636
        >>
25039 craig 637
        (3200) exch dup
638
        (3201) exch dup
639
        (3202) exch dup
640
        (3203) exch dup
641
        (3204) exch dup
642
        (3205) exch dup
25125 craig 643
        pop
644
 
645
        <<
646
            /parts  [
647
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
648
            ]
649
            /ex     [ (321n) ]
650
            /req    [ [ (01) (02) ] ]
651
        >>
25039 craig 652
        (3210) exch dup
653
        (3211) exch dup
654
        (3212) exch dup
655
        (3213) exch dup
656
        (3214) exch dup
657
        (3215) exch dup
25125 craig 658
        pop
659
 
660
        <<
661
            /parts  [
662
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
663
            ]
664
            /ex     [ (322n) ]
665
            /req    [ [ (01) (02) ] ]
666
        >>
25039 craig 667
        (3220) exch dup
668
        (3221) exch dup
669
        (3222) exch dup
670
        (3223) exch dup
671
        (3224) exch dup
672
        (3225) exch dup
25125 craig 673
        pop
674
 
675
        <<
676
            /parts  [
677
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
678
            ]
679
            /ex     [ (323n) ]
680
            /req    [ [ (01) (02) ] ]
681
        >>
25039 craig 682
        (3230) exch dup
683
        (3231) exch dup
684
        (3232) exch dup
685
        (3233) exch dup
686
        (3234) exch dup
687
        (3235) exch dup
25125 craig 688
        pop
689
 
690
        <<
691
            /parts  [
692
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
693
            ]
694
            /ex     [ (324n) ]
695
            /req    [ [ (01) (02) ] ]
696
        >>
25039 craig 697
        (3240) exch dup
698
        (3241) exch dup
699
        (3242) exch dup
700
        (3243) exch dup
701
        (3244) exch dup
702
        (3245) exch dup
25125 craig 703
        pop
704
 
705
        <<
706
            /parts  [
707
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
708
            ]
709
            /ex     [ (325n) ]
710
            /req    [ [ (01) (02) ] ]
711
        >>
25039 craig 712
        (3250) exch dup
713
        (3251) exch dup
714
        (3252) exch dup
715
        (3253) exch dup
716
        (3254) exch dup
717
        (3255) exch dup
25125 craig 718
        pop
719
 
720
        <<
721
            /parts  [
722
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
723
            ]
724
            /ex     [ (326n) ]
725
            /req    [ [ (01) (02) ] ]
726
        >>
25039 craig 727
        (3260) exch dup
728
        (3261) exch dup
729
        (3262) exch dup
730
        (3263) exch dup
731
        (3264) exch dup
732
        (3265) exch dup
25125 craig 733
        pop
734
 
735
        <<
736
            /parts  [
737
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
738
            ]
739
            /ex     [ (327n) ]
740
            /req    [ [ (01) (02) ] ]
741
        >>
25039 craig 742
        (3270) exch dup
743
        (3271) exch dup
744
        (3272) exch dup
745
        (3273) exch dup
746
        (3274) exch dup
747
        (3275) exch dup
25125 craig 748
        pop
749
 
750
        <<
751
            /parts  [
752
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
753
            ]
754
            /ex     [ (328n) ]
755
            /req    [ [ (01) (02) ] ]
756
        >>
25039 craig 757
        (3280) exch dup
758
        (3281) exch dup
759
        (3282) exch dup
760
        (3283) exch dup
761
        (3284) exch dup
762
        (3285) exch dup
25125 craig 763
        pop
764
 
765
        <<
766
            /parts  [
767
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
768
            ]
769
            /ex     [ (329n) ]
770
            /req    [ [ (01) (02) ] ]
771
        >>
25039 craig 772
        (3290) exch dup
773
        (3291) exch dup
774
        (3292) exch dup
775
        (3293) exch dup
776
        (3294) exch dup
777
        (3295) exch dup
25125 craig 778
        pop
779
 
780
        <<
781
            /parts  [
782
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
783
            ]
784
            /ex     [ (330n) ]
785
            /req    [ [ (00) (01) ] ]
786
        >>
25039 craig 787
        (3300) exch dup
788
        (3301) exch dup
789
        (3302) exch dup
790
        (3303) exch dup
791
        (3304) exch dup
792
        (3305) exch dup
25125 craig 793
        pop
794
 
795
        <<
796
            /parts  [
797
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
798
            ]
799
            /ex     [ (331n) ]
800
            /req    [ [ (00) (01) ] ]
801
        >>
25039 craig 802
        (3310) exch dup
803
        (3311) exch dup
804
        (3312) exch dup
805
        (3313) exch dup
806
        (3314) exch dup
807
        (3315) exch dup
25125 craig 808
        pop
809
 
810
        <<
811
            /parts  [
812
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
813
            ]
814
            /ex     [ (332n) ]
815
            /req    [ [ (00) (01) ] ]
816
        >>
25039 craig 817
        (3320) exch dup
818
        (3321) exch dup
819
        (3322) exch dup
820
        (3323) exch dup
821
        (3324) exch dup
822
        (3325) exch dup
25125 craig 823
        pop
824
 
825
        <<
826
            /parts  [
827
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
828
            ]
829
            /ex     [ (333n) ]
830
            /req    [ [ (00) (01) ] ]
831
        >>
25039 craig 832
        (3330) exch dup
833
        (3331) exch dup
834
        (3332) exch dup
835
        (3333) exch dup
836
        (3334) exch dup
837
        (3335) exch dup
25125 craig 838
        pop
839
 
840
        <<
841
            /parts  [
842
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
843
            ]
844
            /ex     [ (334n) ]
845
            /req    [ [ (00) (01) ] ]
846
        >>
25039 craig 847
        (3340) exch dup
848
        (3341) exch dup
849
        (3342) exch dup
850
        (3343) exch dup
851
        (3344) exch dup
852
        (3345) exch dup
25125 craig 853
        pop
854
 
855
        <<
856
            /parts  [
857
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
858
            ]
859
            /ex     [ (335n) ]
860
            /req    [ [ (00) (01) ] ]
861
        >>
25039 craig 862
        (3350) exch dup
863
        (3351) exch dup
864
        (3352) exch dup
865
        (3353) exch dup
866
        (3354) exch dup
867
        (3355) exch dup
25125 craig 868
        pop
869
 
870
        <<
871
            /parts  [
872
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
873
            ]
874
            /ex     [ (336n) ]
875
            /req    [ [ (00) (01) ] ]
876
        >>
25039 craig 877
        (3360) exch dup
878
        (3361) exch dup
879
        (3362) exch dup
880
        (3363) exch dup
881
        (3364) exch dup
882
        (3365) exch dup
25125 craig 883
        pop
884
 
885
        <<
886
            /parts  [
887
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
888
            ]
889
            /ex     [ (337n) ]
890
            /req    [ [ (01) ] ]
891
        >>
25039 craig 892
        (3370) exch dup
893
        (3371) exch dup
894
        (3372) exch dup
895
        (3373) exch dup
896
        (3374) exch dup
897
        (3375) exch dup
25125 craig 898
        pop
899
 
900
        <<
901
            /parts  [
902
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
903
            ]
904
            /ex     [ (340n) ]
905
            /req    [ [ (00) (01) ] ]
906
        >>
25039 craig 907
        (3400) exch dup
908
        (3401) exch dup
909
        (3402) exch dup
910
        (3403) exch dup
911
        (3404) exch dup
912
        (3405) exch dup
25125 craig 913
        pop
914
 
915
        <<
916
            /parts  [
917
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
918
            ]
919
            /ex     [ (341n) ]
920
            /req    [ [ (00) (01) ] ]
921
        >>
25039 craig 922
        (3410) exch dup
923
        (3411) exch dup
924
        (3412) exch dup
925
        (3413) exch dup
926
        (3414) exch dup
927
        (3415) exch dup
25125 craig 928
        pop
929
 
930
        <<
931
            /parts  [
932
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
933
            ]
934
            /ex     [ (342n) ]
935
            /req    [ [ (00) (01) ] ]
936
        >>
25039 craig 937
        (3420) exch dup
938
        (3421) exch dup
939
        (3422) exch dup
940
        (3423) exch dup
941
        (3424) exch dup
942
        (3425) exch dup
25125 craig 943
        pop
944
 
945
        <<
946
            /parts  [
947
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
948
            ]
949
            /ex     [ (343n) ]
950
            /req    [ [ (00) (01) ] ]
951
        >>
25039 craig 952
        (3430) exch dup
953
        (3431) exch dup
954
        (3432) exch dup
955
        (3433) exch dup
956
        (3434) exch dup
957
        (3435) exch dup
25125 craig 958
        pop
959
 
960
        <<
961
            /parts  [
962
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
963
            ]
964
            /ex     [ (344n) ]
965
            /req    [ [ (00) (01) ] ]
966
        >>
25039 craig 967
        (3440) exch dup
968
        (3441) exch dup
969
        (3442) exch dup
970
        (3443) exch dup
971
        (3444) exch dup
972
        (3445) exch dup
25125 craig 973
        pop
974
 
975
        <<
976
            /parts  [
977
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
978
            ]
979
            /ex     [ (345n) ]
980
            /req    [ [ (00) (01) ] ]
981
        >>
25039 craig 982
        (3450) exch dup
983
        (3451) exch dup
984
        (3452) exch dup
985
        (3453) exch dup
986
        (3454) exch dup
987
        (3455) exch dup
25125 craig 988
        pop
989
 
990
        <<
991
            /parts  [
992
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
993
            ]
994
            /ex     [ (346n) ]
995
            /req    [ [ (00) (01) ] ]
996
        >>
25039 craig 997
        (3460) exch dup
998
        (3461) exch dup
999
        (3462) exch dup
1000
        (3463) exch dup
1001
        (3464) exch dup
1002
        (3465) exch dup
25125 craig 1003
        pop
1004
 
1005
        <<
1006
            /parts  [
1007
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
1008
            ]
1009
            /ex     [ (347n) ]
1010
            /req    [ [ (00) (01) ] ]
1011
        >>
25039 craig 1012
        (3470) exch dup
1013
        (3471) exch dup
1014
        (3472) exch dup
1015
        (3473) exch dup
1016
        (3474) exch dup
1017
        (3475) exch dup
25125 craig 1018
        pop
1019
 
1020
        <<
1021
            /parts  [
1022
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
1023
            ]
1024
            /ex     [ (348n) ]
1025
            /req    [ [ (00) (01) ] ]
1026
        >>
25039 craig 1027
        (3480) exch dup
1028
        (3481) exch dup
1029
        (3482) exch dup
1030
        (3483) exch dup
1031
        (3484) exch dup
1032
        (3485) exch dup
25125 craig 1033
        pop
1034
 
1035
        <<
1036
            /parts  [
1037
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
1038
            ]
1039
            /ex     [ (349n) ]
1040
            /req    [ [ (00) (01) ] ]
1041
        >>
25039 craig 1042
        (3490) exch dup
1043
        (3491) exch dup
1044
        (3492) exch dup
1045
        (3493) exch dup
1046
        (3494) exch dup
1047
        (3495) exch dup
25125 craig 1048
        pop
1049
 
1050
        <<
1051
            /parts  [
1052
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
1053
            ]
1054
            /ex     [ (350n) ]
1055
            /req    [ [ (01) (02) ] ]
1056
        >>
25039 craig 1057
        (3500) exch dup
1058
        (3501) exch dup
1059
        (3502) exch dup
1060
        (3503) exch dup
1061
        (3504) exch dup
1062
        (3505) exch dup
25125 craig 1063
        pop
1064
 
1065
        <<
1066
            /parts  [
1067
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
1068
            ]
1069
            /ex     [ (351n) ]
1070
            /req    [ [ (01) (02) ] ]
1071
        >>
25039 craig 1072
        (3510) exch dup
1073
        (3511) exch dup
1074
        (3512) exch dup
1075
        (3513) exch dup
1076
        (3514) exch dup
1077
        (3515) exch dup
25125 craig 1078
        pop
1079
 
1080
        <<
1081
            /parts  [
1082
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
1083
            ]
1084
            /ex     [ (352n) ]
1085
            /req    [ [ (01) (02) ] ]
1086
        >>
25039 craig 1087
        (3520) exch dup
1088
        (3521) exch dup
1089
        (3522) exch dup
1090
        (3523) exch dup
1091
        (3524) exch dup
1092
        (3525) exch dup
25125 craig 1093
        pop
1094
 
1095
        <<
1096
            /parts  [
1097
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
1098
            ]
1099
            /ex     [ (353n) ]
1100
            /req    [ [ (00) (01) ] ]
1101
        >>
25039 craig 1102
        (3530) exch dup
1103
        (3531) exch dup
1104
        (3532) exch dup
1105
        (3533) exch dup
1106
        (3534) exch dup
1107
        (3535) exch dup
25125 craig 1108
        pop
1109
 
1110
        <<
1111
            /parts  [
1112
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
1113
            ]
1114
            /ex     [ (354n) ]
1115
            /req    [ [ (00) (01) ] ]
1116
        >>
25039 craig 1117
        (3540) exch dup
1118
        (3541) exch dup
1119
        (3542) exch dup
1120
        (3543) exch dup
1121
        (3544) exch dup
1122
        (3545) exch dup
25125 craig 1123
        pop
1124
 
1125
        <<
1126
            /parts  [
1127
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
1128
            ]
1129
            /ex     [ (355n) ]
1130
            /req    [ [ (00) (01) ] ]
1131
        >>
25039 craig 1132
        (3550) exch dup
1133
        (3551) exch dup
1134
        (3552) exch dup
1135
        (3553) exch dup
1136
        (3554) exch dup
1137
        (3555) exch dup
25125 craig 1138
        pop
1139
 
1140
        <<
1141
            /parts  [
1142
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
1143
            ]
1144
            /ex     [ (356n) ]
1145
            /req    [ [ (01) (02) ] ]
1146
        >>
25039 craig 1147
        (3560) exch dup
1148
        (3561) exch dup
1149
        (3562) exch dup
1150
        (3563) exch dup
1151
        (3564) exch dup
1152
        (3565) exch dup
25125 craig 1153
        pop
1154
 
1155
        <<
1156
            /parts  [
1157
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
1158
            ]
1159
            /ex     [ (357n) ]
1160
            /req    [ [ (01) (02) ] ]
1161
        >>
25039 craig 1162
        (3570) exch dup
1163
        (3571) exch dup
1164
        (3572) exch dup
1165
        (3573) exch dup
1166
        (3574) exch dup
1167
        (3575) exch dup
25125 craig 1168
        pop
1169
 
1170
        <<
1171
            /parts  [
1172
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
1173
            ]
1174
            /ex     [ (360n) ]
1175
            /req    [ [ (01) (02) ] ]
1176
        >>
25039 craig 1177
        (3600) exch dup
1178
        (3601) exch dup
1179
        (3602) exch dup
1180
        (3603) exch dup
1181
        (3604) exch dup
1182
        (3605) exch dup
25125 craig 1183
        pop
1184
 
1185
        <<
1186
            /parts  [
1187
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
1188
            ]
1189
            /ex     [ (361n) ]
1190
            /req    [ [ (01) (02) ] ]
1191
        >>
25039 craig 1192
        (3610) exch dup
1193
        (3611) exch dup
1194
        (3612) exch dup
1195
        (3613) exch dup
1196
        (3614) exch dup
1197
        (3615) exch dup
25125 craig 1198
        pop
1199
 
1200
        <<
1201
            /parts  [
1202
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
1203
            ]
1204
            /ex     [ (362n) ]
1205
            /req    [ [ (00) (01) ] ]
1206
        >>
25039 craig 1207
        (3620) exch dup
1208
        (3621) exch dup
1209
        (3622) exch dup
1210
        (3623) exch dup
1211
        (3624) exch dup
1212
        (3625) exch dup
25125 craig 1213
        pop
1214
 
1215
        <<
1216
            /parts  [
1217
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
1218
            ]
1219
            /ex     [ (363n) ]
1220
            /req    [ [ (00) (01) ] ]
1221
        >>
25039 craig 1222
        (3630) exch dup
1223
        (3631) exch dup
1224
        (3632) exch dup
1225
        (3633) exch dup
1226
        (3634) exch dup
1227
        (3635) exch dup
25125 craig 1228
        pop
1229
 
1230
        <<
1231
            /parts  [
1232
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
1233
            ]
1234
            /ex     [ (364n) ]
1235
            /req    [ [ (01) (02) ] ]
1236
        >>
25039 craig 1237
        (3640) exch dup
1238
        (3641) exch dup
1239
        (3642) exch dup
1240
        (3643) exch dup
1241
        (3644) exch dup
1242
        (3645) exch dup
25125 craig 1243
        pop
1244
 
1245
        <<
1246
            /parts  [
1247
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
1248
            ]
1249
            /ex     [ (365n) ]
1250
            /req    [ [ (01) (02) ] ]
1251
        >>
25039 craig 1252
        (3650) exch dup
1253
        (3651) exch dup
1254
        (3652) exch dup
1255
        (3653) exch dup
1256
        (3654) exch dup
1257
        (3655) exch dup
25125 craig 1258
        pop
1259
 
1260
        <<
1261
            /parts  [
1262
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
1263
            ]
1264
            /ex     [ (366n) ]
1265
            /req    [ [ (01) (02) ] ]
1266
        >>
25039 craig 1267
        (3660) exch dup
1268
        (3661) exch dup
1269
        (3662) exch dup
1270
        (3663) exch dup
1271
        (3664) exch dup
1272
        (3665) exch dup
25125 craig 1273
        pop
1274
 
1275
        <<
1276
            /parts  [
1277
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
1278
            ]
1279
            /ex     [ (367n) ]
1280
            /req    [ [ (00) (01) ] ]
1281
        >>
25039 craig 1282
        (3670) exch dup
1283
        (3671) exch dup
1284
        (3672) exch dup
1285
        (3673) exch dup
1286
        (3674) exch dup
1287
        (3675) exch dup
25125 craig 1288
        pop
1289
 
1290
        <<
1291
            /parts  [
1292
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
1293
            ]
1294
            /ex     [ (368n) ]
1295
            /req    [ [ (00) (01) ] ]
1296
        >>
25039 craig 1297
        (3680) exch dup
1298
        (3681) exch dup
1299
        (3682) exch dup
1300
        (3683) exch dup
1301
        (3684) exch dup
1302
        (3685) exch dup
25125 craig 1303
        pop
1304
 
1305
        <<
1306
            /parts  [
1307
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
1308
            ]
1309
            /ex     [ (369n) ]
1310
            /req    [ [ (00) (01) ] ]
1311
        >>
25039 craig 1312
        (3690) exch dup
1313
        (3691) exch dup
1314
        (3692) exch dup
1315
        (3693) exch dup
1316
        (3694) exch dup
1317
        (3695) exch dup
1318
        pop
1319
 
25125 craig 1320
        <<
1321
            /parts  [
1322
                << /cset /N  /min  1  /max  8  /opt false  /linters [] >>
1323
            ]
1324
            /req    [ [ (00) ] [ (02) (8026) ] ]
1325
        >>
25039 craig 1326
        (37) exch dup
1327
        pop
1328
 
25125 craig 1329
        <<
1330
            /parts  [
1331
                << /cset /N  /min  1  /max 15  /opt false  /linters [] >>
1332
            ]
1333
            /ex     [ (390n) (391n) (394n) (8111) ]
1334
            /req    [ [ (255) (8020) ] ]
1335
        >>
25039 craig 1336
        (3900) exch dup
1337
        (3901) exch dup
1338
        (3902) exch dup
1339
        (3903) exch dup
1340
        (3904) exch dup
1341
        (3905) exch dup
1342
        (3906) exch dup
1343
        (3907) exch dup
1344
        (3908) exch dup
1345
        (3909) exch dup
1346
        pop
1347
 
25125 craig 1348
        <<
1349
            /parts  [
1350
                << /cset /N  /min  3  /max  3  /opt false  /linters [ /lintiso4217 ] >>
1351
                << /cset /N  /min  1  /max 15  /opt false  /linters [] >>
1352
            ]
1353
            /ex     [ (391n) ]
1354
            /req    [ [ (8020) ] ]
1355
        >>
25039 craig 1356
        (3910) exch dup
1357
        (3911) exch dup
1358
        (3912) exch dup
1359
        (3913) exch dup
1360
        (3914) exch dup
1361
        (3915) exch dup
1362
        (3916) exch dup
1363
        (3917) exch dup
1364
        (3918) exch dup
1365
        (3919) exch dup
1366
        pop
1367
 
25125 craig 1368
        <<
1369
            /parts  [
1370
                << /cset /N  /min  1  /max 15  /opt false  /linters [] >>
1371
            ]
1372
            /ex     [ (392n) (393n) ]
1373
            /req    [ [ (01) ] [ (30) (31nn) (32nn) (35nn) (36nn) ] ]
1374
        >>
25039 craig 1375
        (3920) exch dup
1376
        (3921) exch dup
1377
        (3922) exch dup
1378
        (3923) exch dup
1379
        (3924) exch dup
1380
        (3925) exch dup
1381
        (3926) exch dup
1382
        (3927) exch dup
1383
        (3928) exch dup
1384
        (3929) exch dup
1385
        pop
1386
 
25125 craig 1387
        <<
1388
            /parts  [
1389
                << /cset /N  /min  3  /max  3  /opt false  /linters [ /lintiso4217 ] >>
1390
                << /cset /N  /min  1  /max 15  /opt false  /linters [] >>
1391
            ]
1392
            /ex     [ (393n) ]
1393
            /req    [ [ (30) (31nn) (32nn) (35nn) (36nn) ] ]
1394
        >>
25039 craig 1395
        (3930) exch dup
1396
        (3931) exch dup
1397
        (3932) exch dup
1398
        (3933) exch dup
1399
        (3934) exch dup
1400
        (3935) exch dup
1401
        (3936) exch dup
1402
        (3937) exch dup
1403
        (3938) exch dup
1404
        (3939) exch dup
1405
        pop
1406
 
25125 craig 1407
        <<
1408
            /parts  [
1409
                << /cset /N  /min  4  /max  4  /opt false  /linters [] >>
1410
            ]
1411
            /ex     [ (394n) (8111) ]
1412
            /req    [ [ (255) ] ]
1413
        >>
25039 craig 1414
        (3940) exch dup
1415
        (3941) exch dup
1416
        (3942) exch dup
1417
        (3943) exch dup
1418
        pop
1419
 
25125 craig 1420
        <<
1421
            /parts  [
1422
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
1423
            ]
1424
            /ex     [ (392n) (393n) (395n) (8005) ]
1425
            /req    [ [ (30) (31nn) (32nn) (35nn) (36nn) ] ]
1426
        >>
25039 craig 1427
        (3950) exch dup
1428
        (3951) exch dup
1429
        (3952) exch dup
1430
        (3953) exch dup
1431
        (3954) exch dup
1432
        (3955) exch dup
1433
        pop
1434
 
25125 craig 1435
        <<
1436
            /parts  [
1437
                << /cset /X  /min  1  /max 30  /opt false  /linters [] >>
1438
            ]
1439
        >>
25039 craig 1440
        (400) exch dup
1441
        pop
1442
 
25125 craig 1443
        <<
1444
            /parts  [
1445
                << /cset /X  /min  1  /max 30  /opt false  /linters [ /lintkey ] >>
1446
            ]
1447
            /dlpkey [ ]
1448
        >>
25039 craig 1449
        (401) exch dup
1450
        pop
1451
 
25125 craig 1452
        <<
1453
            /parts  [
1454
                << /cset /N  /min 17  /max 17  /opt false  /linters [ /lintcsum /lintkey ] >>
1455
            ]
1456
            /dlpkey [ ]
1457
        >>
25039 craig 1458
        (402) exch dup
1459
        pop
1460
 
25125 craig 1461
        <<
1462
            /parts  [
1463
                << /cset /X  /min  1  /max 30  /opt false  /linters [] >>
1464
            ]
1465
            /req    [ [ (00) ] ]
1466
        >>
25039 craig 1467
        (403) exch dup
1468
        pop
1469
 
25125 craig 1470
        <<
1471
            /parts  [
1472
                << /cset /N  /min 13  /max 13  /opt false  /linters [ /lintcsum /lintkey ] >>
1473
            ]
1474
        >>
25039 craig 1475
        (410) exch dup
1476
        (411) exch dup
1477
        (412) exch dup
1478
        (413) exch dup
25125 craig 1479
        pop
1480
 
1481
        <<
1482
            /parts  [
1483
                << /cset /N  /min 13  /max 13  /opt false  /linters [ /lintcsum /lintkey ] >>
1484
            ]
1485
            /dlpkey [ [ (254) ] [ (7040) ] ]
1486
        >>
25039 craig 1487
        (414) exch dup
25125 craig 1488
        pop
1489
 
1490
        <<
1491
            /parts  [
1492
                << /cset /N  /min 13  /max 13  /opt false  /linters [ /lintcsum /lintkey ] >>
1493
            ]
1494
            /req    [ [ (8020) ] ]
1495
        >>
25039 craig 1496
        (415) exch dup
25125 craig 1497
        pop
1498
 
1499
        <<
1500
            /parts  [
1501
                << /cset /N  /min 13  /max 13  /opt false  /linters [ /lintcsum /lintkey ] >>
1502
            ]
1503
        >>
25039 craig 1504
        (416) exch dup
25125 craig 1505
        pop
1506
 
1507
        <<
1508
            /parts  [
1509
                << /cset /N  /min 13  /max 13  /opt false  /linters [ /lintcsum /lintkey ] >>
1510
            ]
1511
            /dlpkey [ [ (7040) ] ]
1512
        >>
25039 craig 1513
        (417) exch dup
1514
        pop
1515
 
25125 craig 1516
        <<
1517
            /parts  [
1518
                << /cset /X  /min  1  /max 20  /opt false  /linters [] >>
1519
            ]
1520
            /ex     [ (421) ]
1521
        >>
25039 craig 1522
        (420) exch dup
1523
        pop
1524
 
25125 craig 1525
        <<
1526
            /parts  [
1527
                << /cset /N  /min  3  /max  3  /opt false  /linters [ /lintiso3166 ] >>
1528
                << /cset /X  /min  1  /max  9  /opt false  /linters [] >>
1529
            ]
1530
            /ex     [ (4307) ]
1531
        >>
25039 craig 1532
        (421) exch dup
1533
        pop
1534
 
25125 craig 1535
        <<
1536
            /parts  [
1537
                << /cset /N  /min  3  /max  3  /opt false  /linters [ /lintiso3166 ] >>
1538
            ]
1539
            /ex     [ (426) ]
1540
            /req    [ [ (01) (02) (8006) (8026) ] ]
1541
        >>
25039 craig 1542
        (422) exch dup
1543
        pop
1544
 
25125 craig 1545
        <<
1546
            /parts  [
1547
                << /cset /N  /min  1  /max 15  /opt false  /linters [ /lintiso3166list ] >>
1548
            ]
1549
            /ex     [ (426) ]
1550
            /req    [ [ (01) (02) ] ]
1551
        >>
25039 craig 1552
        (423) exch dup
1553
        pop
1554
 
25125 craig 1555
        <<
1556
            /parts  [
1557
                << /cset /N  /min  3  /max  3  /opt false  /linters [ /lintiso3166 ] >>
1558
            ]
1559
            /ex     [ (426) ]
1560
            /req    [ [ (01) (02) ] ]
1561
        >>
25039 craig 1562
        (424) exch dup
1563
        pop
1564
 
25125 craig 1565
        <<
1566
            /parts  [
1567
                << /cset /N  /min  1  /max 15  /opt false  /linters [ /lintiso3166list ] >>
1568
            ]
1569
            /ex     [ (426) ]
1570
            /req    [ [ (01) (02) ] ]
1571
        >>
25039 craig 1572
        (425) exch dup
1573
        pop
1574
 
25125 craig 1575
        <<
1576
            /parts  [
1577
                << /cset /N  /min  3  /max  3  /opt false  /linters [ /lintiso3166 ] >>
1578
            ]
1579
            /req    [ [ (01) (02) ] ]
1580
        >>
25039 craig 1581
        (426) exch dup
1582
        pop
1583
 
25125 craig 1584
        <<
1585
            /parts  [
1586
                << /cset /X  /min  1  /max  3  /opt false  /linters [] >>
1587
            ]
1588
            /req    [ [ (01) (02) ] [ (422) ] ]
1589
        >>
25039 craig 1590
        (427) exch dup
1591
        pop
1592
 
25125 craig 1593
        <<
1594
            /parts  [
1595
                << /cset /X  /min  1  /max 35  /opt false  /linters [ /lintpcenc ] >>
1596
            ]
1597
            /req    [ [ (00) ] ]
1598
        >>
25039 craig 1599
        (4300) exch dup
1600
        (4301) exch dup
1601
        pop
1602
 
25125 craig 1603
        <<
1604
            /parts  [
1605
                << /cset /X  /min  1  /max 70  /opt false  /linters [ /lintpcenc ] >>
1606
            ]
1607
            /req    [ [ (00) ] ]
1608
        >>
25039 craig 1609
        (4302) exch dup
25125 craig 1610
        pop
1611
 
1612
        <<
1613
            /parts  [
1614
                << /cset /X  /min  1  /max 70  /opt false  /linters [ /lintpcenc ] >>
1615
            ]
1616
            /req    [ [ (4302) ] ]
1617
        >>
25039 craig 1618
        (4303) exch dup
25125 craig 1619
        pop
1620
 
1621
        <<
1622
            /parts  [
1623
                << /cset /X  /min  1  /max 70  /opt false  /linters [ /lintpcenc ] >>
1624
            ]
1625
            /req    [ [ (00) ] ]
1626
        >>
25039 craig 1627
        (4304) exch dup
1628
        (4305) exch dup
1629
        (4306) exch dup
1630
        pop
1631
 
25125 craig 1632
        <<
1633
            /parts  [
1634
                << /cset /X  /min  2  /max  2  /opt false  /linters [ /lintiso3166alpha2 ] >>
1635
            ]
1636
            /req    [ [ (00) ] ]
1637
        >>
25039 craig 1638
        (4307) exch dup
1639
        pop
1640
 
25125 craig 1641
        <<
1642
            /parts  [
1643
                << /cset /X  /min  1  /max 30  /opt false  /linters [] >>
1644
            ]
1645
            /req    [ [ (00) ] ]
1646
        >>
25039 craig 1647
        (4308) exch dup
1648
        pop
1649
 
25125 craig 1650
        <<
1651
            /parts  [
1652
                << /cset /N  /min 20  /max 20  /opt false  /linters [ /lintlatlong ] >>
1653
            ]
1654
            /req    [ [ (00) ] ]
1655
        >>
1656
        (4309) exch dup
1657
        pop
1658
 
1659
        <<
1660
            /parts  [
1661
                << /cset /X  /min  1  /max 35  /opt false  /linters [ /lintpcenc ] >>
1662
            ]
1663
            /req    [ [ (00) ] ]
1664
        >>
25039 craig 1665
        (4310) exch dup
1666
        (4311) exch dup
1667
        pop
1668
 
25125 craig 1669
        <<
1670
            /parts  [
1671
                << /cset /X  /min  1  /max 70  /opt false  /linters [ /lintpcenc ] >>
1672
            ]
1673
            /req    [ [ (00) ] ]
1674
        >>
25039 craig 1675
        (4312) exch dup
25125 craig 1676
        pop
1677
 
1678
        <<
1679
            /parts  [
1680
                << /cset /X  /min  1  /max 70  /opt false  /linters [ /lintpcenc ] >>
1681
            ]
1682
            /req    [ [ (4312) ] ]
1683
        >>
25039 craig 1684
        (4313) exch dup
25125 craig 1685
        pop
1686
 
1687
        <<
1688
            /parts  [
1689
                << /cset /X  /min  1  /max 70  /opt false  /linters [ /lintpcenc ] >>
1690
            ]
1691
            /req    [ [ (00) ] ]
1692
        >>
25039 craig 1693
        (4314) exch dup
1694
        (4315) exch dup
1695
        (4316) exch dup
1696
        pop
1697
 
25125 craig 1698
        <<
1699
            /parts  [
1700
                << /cset /X  /min  2  /max  2  /opt false  /linters [ /lintiso3166alpha2 ] >>
1701
            ]
1702
            /req    [ [ (00) ] ]
1703
        >>
25039 craig 1704
        (4317) exch dup
1705
        pop
1706
 
25125 craig 1707
        <<
1708
            /parts  [
1709
                << /cset /X  /min  1  /max 20  /opt false  /linters [] >>
1710
            ]
1711
            /req    [ [ (00) ] ]
1712
        >>
25039 craig 1713
        (4318) exch dup
1714
        pop
1715
 
25125 craig 1716
        <<
1717
            /parts  [
1718
                << /cset /X  /min  1  /max 30  /opt false  /linters [] >>
1719
            ]
1720
            /req    [ [ (00) ] ]
1721
        >>
25039 craig 1722
        (4319) exch dup
1723
        pop
1724
 
25125 craig 1725
        <<
1726
            /parts  [
1727
                << /cset /X  /min  1  /max 35  /opt false  /linters [ /lintpcenc ] >>
1728
            ]
1729
            /req    [ [ (00) ] ]
1730
        >>
25039 craig 1731
        (4320) exch dup
1732
        pop
1733
 
25125 craig 1734
        <<
1735
            /parts  [
1736
                << /cset /N  /min  1  /max  1  /opt false  /linters [ /lintyesno ] >>
1737
            ]
1738
            /req    [ [ (00) ] ]
1739
        >>
25039 craig 1740
        (4321) exch dup
1741
        (4322) exch dup
1742
        (4323) exch dup
1743
        pop
1744
 
25125 craig 1745
        <<
1746
            /parts  [
1747
                << /cset /N  /min  6  /max  6  /opt false  /linters [ /lintyymmd0 ] >>
1748
                << /cset /N  /min  4  /max  4  /opt false  /linters [ /linthhmm ] >>
1749
            ]
1750
            /req    [ [ (00) ] ]
1751
        >>
25039 craig 1752
        (4324) exch dup
1753
        (4325) exch dup
1754
        pop
1755
 
25125 craig 1756
        <<
1757
            /parts  [
1758
                << /cset /N  /min  6  /max  6  /opt false  /linters [ /lintyymmdd ] >>
1759
            ]
1760
            /req    [ [ (00) ] ]
1761
        >>
25039 craig 1762
        (4326) exch dup
1763
        pop
1764
 
25125 craig 1765
        <<
1766
            /parts  [
1767
                << /cset /N  /min 13  /max 13  /opt false  /linters [] >>
1768
            ]
1769
            /req    [ [ (01) (02) (8006) (8026) ] ]
1770
        >>
25039 craig 1771
        (7001) exch dup
1772
        pop
1773
 
25125 craig 1774
        <<
1775
            /parts  [
1776
                << /cset /X  /min  1  /max 30  /opt false  /linters [] >>
1777
            ]
1778
            /req    [ [ (01) (02) ] ]
1779
        >>
25039 craig 1780
        (7002) exch dup
1781
        pop
1782
 
25125 craig 1783
        <<
1784
            /parts  [
1785
                << /cset /N  /min  6  /max  6  /opt false  /linters [ /lintyymmdd ] >>
1786
                << /cset /N  /min  4  /max  4  /opt false  /linters [ /linthhmm ] >>
1787
            ]
1788
            /req    [ [ (01) (02) ] ]
1789
        >>
25039 craig 1790
        (7003) exch dup
1791
        pop
1792
 
25125 craig 1793
        <<
1794
            /parts  [
1795
                << /cset /N  /min  1  /max  4  /opt false  /linters [] >>
1796
            ]
1797
            /req    [ [ (01) ] [ (10) ] ]
1798
        >>
25039 craig 1799
        (7004) exch dup
1800
        pop
1801
 
25125 craig 1802
        <<
1803
            /parts  [
1804
                << /cset /X  /min  1  /max 12  /opt false  /linters [] >>
1805
            ]
1806
            /req    [ [ (01) (02) ] ]
1807
        >>
25039 craig 1808
        (7005) exch dup
1809
        pop
1810
 
25125 craig 1811
        <<
1812
            /parts  [
1813
                << /cset /N  /min  6  /max  6  /opt false  /linters [ /lintyymmdd ] >>
1814
            ]
1815
            /req    [ [ (01) (02) ] ]
1816
        >>
25039 craig 1817
        (7006) exch dup
1818
        pop
1819
 
25125 craig 1820
        <<
1821
            /parts  [
1822
                << /cset /N  /min  6  /max  6  /opt false  /linters [ /lintyymmdd ] >>
1823
                << /cset /N  /min  6  /max  6  /opt true   /linters [ /lintyymmdd ] >>
1824
            ]
1825
            /req    [ [ (01) (02) ] ]
1826
        >>
25039 craig 1827
        (7007) exch dup
1828
        pop
1829
 
25125 craig 1830
        <<
1831
            /parts  [
1832
                << /cset /X  /min  1  /max  3  /opt false  /linters [] >>
1833
            ]
1834
            /req    [ [ (01) (02) ] ]
1835
        >>
25039 craig 1836
        (7008) exch dup
1837
        pop
1838
 
25125 craig 1839
        <<
1840
            /parts  [
1841
                << /cset /X  /min  1  /max 10  /opt false  /linters [] >>
1842
            ]
1843
            /req    [ [ (01) (02) ] ]
1844
        >>
25039 craig 1845
        (7009) exch dup
1846
        pop
1847
 
25125 craig 1848
        <<
1849
            /parts  [
1850
                << /cset /X  /min  1  /max  2  /opt false  /linters [] >>
1851
            ]
1852
            /req    [ [ (01) (02) ] ]
1853
        >>
25039 craig 1854
        (7010) exch dup
1855
        pop
1856
 
25125 craig 1857
        <<
1858
            /parts  [
1859
                << /cset /X  /min  1  /max 20  /opt false  /linters [] >>
1860
            ]
1861
            /req    [ [ (01) (8006) ] [ (416) ] ]
1862
        >>
25039 craig 1863
        (7020) exch dup
25125 craig 1864
        pop
1865
 
1866
        <<
1867
            /parts  [
1868
                << /cset /X  /min  1  /max 20  /opt false  /linters [] >>
1869
            ]
1870
            /req    [ [ (01) (8006) ] ]
1871
        >>
25039 craig 1872
        (7021) exch dup
25125 craig 1873
        pop
1874
 
1875
        <<
1876
            /parts  [
1877
                << /cset /X  /min  1  /max 20  /opt false  /linters [] >>
1878
            ]
1879
            /req    [ [ (7021) ] ]
1880
        >>
25039 craig 1881
        (7022) exch dup
1882
        pop
1883
 
25125 craig 1884
        <<
1885
            /parts  [
1886
                << /cset /X  /min  1  /max 30  /opt false  /linters [ /lintkey ] >>
1887
            ]
1888
        >>
25039 craig 1889
        (7023) exch dup
1890
        pop
1891
 
25125 craig 1892
        <<
1893
            /parts  [
1894
                << /cset /N  /min  3  /max  3  /opt false  /linters [ /lintiso3166999 ] >>
1895
                << /cset /X  /min  1  /max 27  /opt false  /linters [] >>
1896
            ]
1897
            /req    [ [ (01) (02) ] ]
1898
        >>
25039 craig 1899
        (7030) exch dup
1900
        (7031) exch dup
1901
        (7032) exch dup
1902
        (7033) exch dup
1903
        (7034) exch dup
1904
        (7035) exch dup
1905
        (7036) exch dup
1906
        (7037) exch dup
1907
        (7038) exch dup
1908
        (7039) exch dup
1909
        pop
1910
 
25125 craig 1911
        <<
1912
            /parts  [
1913
                << /cset /N  /min  1  /max  1  /opt false  /linters [] >>
1914
                << /cset /X  /min  1  /max  1  /opt false  /linters [] >>
1915
                << /cset /X  /min  1  /max  1  /opt false  /linters [] >>
1916
                << /cset /X  /min  1  /max  1  /opt false  /linters [ /lintimporteridx ] >>
1917
            ]
1918
        >>
25039 craig 1919
        (7040) exch dup
1920
        pop
1921
 
25125 craig 1922
        <<
1923
            /parts  [
1924
                << /cset /X  /min  1  /max 20  /opt false  /linters [] >>
1925
            ]
1926
            /req    [ [ (01) ] ]
1927
        >>
25039 craig 1928
        (710) exch dup
1929
        (711) exch dup
1930
        (712) exch dup
1931
        (713) exch dup
1932
        (714) exch dup
1933
        (715) exch dup
1934
        pop
1935
 
25125 craig 1936
        <<
1937
            /parts  [
1938
                << /cset /X  /min  2  /max  2  /opt false  /linters [] >>
1939
                << /cset /X  /min  1  /max 28  /opt false  /linters [] >>
1940
            ]
1941
            /req    [ [ (01) (8004) ] ]
1942
        >>
25039 craig 1943
        (7230) exch dup
1944
        (7231) exch dup
1945
        (7232) exch dup
1946
        (7233) exch dup
1947
        (7234) exch dup
1948
        (7235) exch dup
1949
        (7236) exch dup
1950
        (7237) exch dup
1951
        (7238) exch dup
1952
        (7239) exch dup
1953
        pop
1954
 
25125 craig 1955
        <<
1956
            /parts  [
1957
                << /cset /X  /min  1  /max 20  /opt false  /linters [] >>
1958
            ]
1959
            /req    [ [ (01) (8006) ] ]
1960
        >>
25039 craig 1961
        (7240) exch dup
1962
        pop
1963
 
25125 craig 1964
        <<
1965
            /parts  [
1966
                << /cset /N  /min  4  /max  4  /opt false  /linters [ /lintnonzero ] >>
1967
                << /cset /N  /min  5  /max  5  /opt false  /linters [ /lintnonzero ] >>
1968
                << /cset /N  /min  3  /max  3  /opt false  /linters [ /lintnonzero ] >>
1969
                << /cset /N  /min  1  /max  1  /opt false  /linters [ /lintwinding ] >>
1970
                << /cset /N  /min  1  /max  1  /opt false  /linters [] >>
1971
            ]
1972
            /req    [ [ (01) ] ]
1973
        >>
25039 craig 1974
        (8001) exch dup
1975
        pop
1976
 
25125 craig 1977
        <<
1978
            /parts  [
1979
                << /cset /X  /min  1  /max 20  /opt false  /linters [] >>
1980
            ]
1981
        >>
25039 craig 1982
        (8002) exch dup
1983
        pop
1984
 
25125 craig 1985
        <<
1986
            /parts  [
1987
                << /cset /N  /min  1  /max  1  /opt false  /linters [ /lintzero ] >>
1988
                << /cset /N  /min 13  /max 13  /opt false  /linters [ /lintcsum /lintkey ] >>
1989
                << /cset /X  /min  1  /max 16  /opt true   /linters [] >>
1990
            ]
1991
            /dlpkey [ ]
1992
        >>
25039 craig 1993
        (8003) exch dup
1994
        pop
1995
 
25125 craig 1996
        <<
1997
            /parts  [
1998
                << /cset /X  /min  1  /max 30  /opt false  /linters [ /lintkey ] >>
1999
            ]
2000
            /dlpkey [ [ (7040) ] ]
2001
        >>
25039 craig 2002
        (8004) exch dup
2003
        pop
2004
 
25125 craig 2005
        <<
2006
            /parts  [
2007
                << /cset /N  /min  6  /max  6  /opt false  /linters [] >>
2008
            ]
2009
            /req    [ [ (01) (02) ] ]
2010
        >>
25039 craig 2011
        (8005) exch dup
2012
        pop
2013
 
25125 craig 2014
        <<
2015
            /parts  [
2016
                << /cset /N  /min 14  /max 14  /opt false  /linters [ /lintcsum ] >>
2017
                << /cset /N  /min  4  /max  4  /opt false  /linters [ /lintpieceoftotal ] >>
2018
            ]
2019
            /ex     [ (01) (37) ]
2020
            /dlpkey [ [ (22) (10) (21) ] ]
2021
        >>
25039 craig 2022
        (8006) exch dup
2023
        pop
2024
 
25125 craig 2025
        <<
2026
            /parts  [
2027
                << /cset /X  /min  1  /max 34  /opt false  /linters [ /lintiban ] >>
2028
            ]
2029
            /req    [ [ (415) ] ]
2030
        >>
25039 craig 2031
        (8007) exch dup
2032
        pop
2033
 
25125 craig 2034
        <<
2035
            /parts  [
2036
                << /cset /N  /min  8  /max  8  /opt false  /linters [ /lintyymmddhh ] >>
2037
                << /cset /N  /min  1  /max  4  /opt true   /linters [ /lintmmoptss ] >>
2038
            ]
2039
            /req    [ [ (01) (02) ] ]
2040
        >>
25039 craig 2041
        (8008) exch dup
2042
        pop
2043
 
25125 craig 2044
        <<
2045
            /parts  [
2046
                << /cset /X  /min  1  /max 50  /opt false  /linters [] >>
2047
            ]
2048
            /req    [ [ (00) (01) ] ]
2049
        >>
25039 craig 2050
        (8009) exch dup
2051
        pop
2052
 
25125 craig 2053
        <<
2054
            /parts  [
2055
                << /cset /Y  /min  1  /max 30  /opt false  /linters [ /lintkey ] >>
2056
            ]
2057
            /dlpkey [ [ (8011) ] ]
2058
        >>
25039 craig 2059
        (8010) exch dup
2060
        pop
2061
 
25125 craig 2062
        <<
2063
            /parts  [
2064
                << /cset /N  /min  1  /max 12  /opt false  /linters [ /lintnozeroprefix ] >>
2065
            ]
2066
            /req    [ [ (8010) ] ]
2067
        >>
25039 craig 2068
        (8011) exch dup
2069
        pop
2070
 
25125 craig 2071
        <<
2072
            /parts  [
2073
                << /cset /X  /min  1  /max 20  /opt false  /linters [] >>
2074
            ]
2075
            /req    [ [ (01) (8006) ] ]
2076
        >>
25039 craig 2077
        (8012) exch dup
2078
        pop
2079
 
25125 craig 2080
        <<
2081
            /parts  [
2082
                << /cset /X  /min  1  /max 25  /opt false  /linters [ /lintcsumalpha /lintkey ] >>
2083
            ]
2084
            /dlpkey [ ]
2085
        >>
25039 craig 2086
        (8013) exch dup
2087
        pop
2088
 
25125 craig 2089
        <<
2090
            /parts  [
2091
                << /cset /N  /min 18  /max 18  /opt false  /linters [ /lintcsum ] >>
2092
            ]
2093
            /dlpkey [ [ (8019) ] ]
2094
        >>
25039 craig 2095
        (8017) exch dup
25125 craig 2096
        pop
2097
 
2098
        <<
2099
            /parts  [
2100
                << /cset /N  /min 18  /max 18  /opt false  /linters [ /lintcsum ] >>
2101
            ]
2102
            /ex     [ (8017) ]
2103
            /dlpkey [ [ (8019) ] ]
2104
        >>
25039 craig 2105
        (8018) exch dup
2106
        pop
2107
 
25125 craig 2108
        <<
2109
            /parts  [
2110
                << /cset /N  /min  1  /max 10  /opt false  /linters [] >>
2111
            ]
2112
            /req    [ [ (8017) (8018) ] ]
2113
        >>
25039 craig 2114
        (8019) exch dup
2115
        pop
2116
 
25125 craig 2117
        <<
2118
            /parts  [
2119
                << /cset /X  /min  1  /max 25  /opt false  /linters [] >>
2120
            ]
2121
            /req    [ [ (415) ] ]
2122
        >>
25039 craig 2123
        (8020) exch dup
2124
        pop
2125
 
25125 craig 2126
        <<
2127
            /parts  [
2128
                << /cset /N  /min 14  /max 14  /opt false  /linters [ /lintcsum ] >>
2129
                << /cset /N  /min  4  /max  4  /opt false  /linters [ /lintpieceoftotal ] >>
2130
            ]
2131
            /ex     [ (02) (8006) ]
2132
            /req    [ [ (37) ] ]
2133
        >>
25039 craig 2134
        (8026) exch dup
2135
        pop
2136
 
25125 craig 2137
        <<
2138
            /parts  [
2139
                << /cset /X  /min  1  /max 70  /opt false  /linters [ /lintcouponcode ] >>
2140
            ]
2141
        >>
25039 craig 2142
        (8110) exch dup
2143
        pop
2144
 
25125 craig 2145
        <<
2146
            /parts  [
2147
                << /cset /N  /min  4  /max  4  /opt false  /linters [] >>
2148
            ]
2149
            /req    [ [ (255) ] ]
2150
        >>
25039 craig 2151
        (8111) exch dup
2152
        pop
2153
 
25125 craig 2154
        <<
2155
            /parts  [
2156
                << /cset /X  /min  1  /max 70  /opt false  /linters [ /lintcouponposoffer ] >>
2157
            ]
2158
        >>
25039 craig 2159
        (8112) exch dup
2160
        pop
2161
 
25125 craig 2162
        <<
2163
            /parts  [
2164
                << /cset /X  /min  1  /max 70  /opt false  /linters [] >>
2165
            ]
2166
            /req    [ [ (01) ] ]
2167
        >>
25039 craig 2168
        (8200) exch dup
2169
        pop
2170
 
25125 craig 2171
        <<
2172
            /parts  [
2173
                << /cset /X  /min  1  /max 30  /opt false  /linters [] >>
2174
            ]
2175
        >>
25039 craig 2176
        (90) exch dup
2177
        pop
2178
 
25125 craig 2179
        <<
2180
            /parts  [
2181
                << /cset /X  /min  1  /max 90  /opt false  /linters [] >>
2182
            ]
2183
        >>
25039 craig 2184
        (91) exch dup
2185
        (92) exch dup
2186
        (93) exch dup
2187
        (94) exch dup
2188
        (95) exch dup
2189
        (96) exch dup
2190
        (97) exch dup
2191
        (98) exch dup
2192
        (99) exch dup
2193
        pop
2194
 
2195
    >> def
25125 craig 2196
} ctxdef
25039 craig 2197
 
25125 craig 2198
    % Extract AIs and vals from provided GS1 data in the indicated format
2199
 
2200
    /ai eq {  % Bracketed AI element string
2201
 
2202
        % Parse out AIs and values
2203
        (\() anchorsearch not {
2204
            pop /bwipp.GS1aiMissingOpenParen (AIs must start with '\(') //raiseerror exec
2205
        } if
2206
        pop
2207
        mark exch {  % loop
2208
            dup () eq {pop exit} if
2209
            (\)) search not {
2210
                cleartomark /bwipp.GS1aiMissingCloseParen (AIs must end with '\)') //raiseerror exec
2211
            } if
2212
            exch pop exch
2213
            (\() search { exch pop exch } { () } ifelse
2214
        } loop
2215
        counttomark dup 0 gt {dup 2 idiv 1 add -1 exch {-1 roll} for} {pop} ifelse
2216
        counttomark 2 idiv array astore /ais exch def
2217
        counttomark array astore [ exch {  % Expand ordinals of the form ^NNN to ASCII
2218
            << /parse parse /parseonly true /parsefnc false >> //parseinput exec
2219
        } forall ] /vals exch def
2220
        pop
2221
 
2222
    } {  % Digital Link URI
2223
 
2224
        % Validate and strip the scheme
2225
        (http://) anchorsearch not {
2226
        (https://) anchorsearch not {
2227
            pop /bwipp.GS1dlURIbadScheme (Scheme must be http:// or https://) //raiseerror exec
2228
        } if} if
2229
        pop
2230
 
2231
        % Strip the domain
2232
        (/) search not {
2233
            pop /bwipp.GS1dlMissingDomainOrPathInfo (URI must contain a domain and path info) //raiseerror exec
2234
        } if
2235
        pop pop
2236
 
2237
        % Fragment delimits end of data
2238
        (#) search {
2239
            exch pop exch pop
2240
        } if
2241
 
2242
        % Query parameter marker splits path info and query parameters
2243
        (?) search not {
2244
            () exch null exch
2245
        } if
2246
        /pp exch def
2247
        pop
2248
        /qp exch def
2249
 
2250
        % Find positions of character immediately following "/" in the path info
2251
        mark 0
2252
 
2253
            (/) search not {pop exit} if
2254
            length 1 add exch pop 2 index add exch
2255
        } loop
2256
        counttomark 1 sub array astore /pipos exch def pop pop
2257
        pipos length 1 le {
2258
            /bwipp.GS1dlNoAIinfo (The path was too short to contain AI info) //raiseerror exec
2259
        } if
2260
 
2261
        % Walk backwards to find the right-most path element that is a valid dlpkey
2262
        false
2263
        pipos length 2 sub -2 0 {
2264
            dup
2265
            dup pipos exch get
2266
            exch pipos exch 1 add get 1 index sub 1 sub pp 3 1 roll getinterval
2267
            dup gs1syntax exch known {
2268
                gs1syntax exch get /dlpkey known {
2269
                    exch pop true exit
25039 craig 2270
                } if
25125 craig 2271
            } {
2272
                pop
2273
            } ifelse
2274
            pop
2275
        } for
2276
        not {
2277
            /bwipp.GS1dlNoAIinfo (The path does not contain a valid primary key) //raiseerror exec
2278
        } if
2279
        pipos exch get dup pp length exch sub pp 3 1 roll getinterval /pp exch def
2280
 
2281
        /uriunescape {
2282
            /in exch def
2283
            /out in length string def
2284
 
2285
                1 index in length ge {exit} if
2286
                in 2 index get
2287
                dup 43 eq {  % "+" -> " "
2288
                    pop out 1 index 32 put
2289
                    1 add exch 1 add exch
2290
                } {
2291
                dup 37 eq 3 index in length 2 sub lt and {  % "%nn" -> ord
2292
                    pop
2293
                    (<  >) 4 string copy dup 1 in 5 index 1 add 2 getinterval putinterval cvx
2294
                    stopped {
2295
                        pop pop raiseerror_invalid_hex_character
2296
                    } if
2297
 
2298
                    1 add exch 3 add exch
2299
                } {
2300
                    out exch 2 index exch put
2301
                    1 add exch 1 add exch
2302
                } ifelse } ifelse
2303
            } loop
2304
            out exch 0 exch getinterval /out exch def
2305
            pop
2306
            out
2307
        } def
2308
 
2309
        /ais 99 array def
2310
        /vals 99 array def
2311
 
2312
 
2313
        % Extract AIs from the path components
2314
        pp {
2315
            (/) search {
2316
                ais exch 4 index exch put
2317
                pop
2318
                (/) search {exch pop} {() exch} ifelse
2319
                vals exch 3 index exch uriunescape put
2320
            } {
2321
                pop exit
2322
            } ifelse
2323
            exch 1 add exch
2324
        } loop
2325
 
2326
        % Validate the key-qualifiers in the path info sequence
2327
        dup 1 gt {
2328
            false
2329
            gs1syntax ais 0 get get /dlpkey get {
2330
                /seq exch def
2331
                /i 1 def  /j 0 def
2332
                {
2333
                    i ais length ge {exit} if
2334
                    j seq length ge {exit} if
2335
                    ais i get seq j get eq {
2336
                        /i i 1 add def
2337
                    } if
2338
                    /j j 1 add def
2339
                } loop
2340
                i 2 index eq {pop true exit} if
25039 craig 2341
            } forall
25125 craig 2342
            not {
2343
                pop /bwipp.GS1dlBadPathInfo (The AIs in the path are not a valid key-qualifier sequence for the key) //raiseerror exec
25039 craig 2344
            } if
25125 craig 2345
        } if
2346
 
2347
        % Extract AIs from the query parameters
2348
        qp {
2349
            dup () eq {pop exit} if
2350
            (&) search {exch pop} {() exch} ifelse
2351
            (=) search {
2352
                true 1 index {dup 48 ge exch 57 le and and} forall {
2353
                    ais exch 5 index exch put
2354
                    pop
2355
                    vals exch 3 index exch uriunescape put
2356
                    exch 1 add exch
2357
                } {  % Ignore non-numeric parameters
2358
                    pop pop pop
2359
                } ifelse
2360
            } {  % Ignore singletons and empty parameters
2361
                pop
2362
            } ifelse
2363
        } loop
2364
 
2365
        /ais ais 0 3 index getinterval def
2366
        /vals vals 0 3 index getinterval def
2367
        pop
2368
 
2369
        % Expand any extracted GTINs
2370
 
2371
            dup ais exch get (01) eq {
2372
                dup vals exch get
2373
                dup length dup 8 eq exch dup 12 eq exch 13 eq or or {
2374
                    (00000000000000) 14 string copy dup 3 -1 roll dup length 14 exch sub exch putinterval
2375
                    vals exch 2 index exch put
2376
                } {
2377
                    pop
2378
                } ifelse
2379
            } if
2380
            pop
2381
        } for
2382
 
2383
    } ifelse
2384
 
2385
    % AIs not requiring FNC1 separation
2386
{
2387
    /aifixed << [
2388
        (00) (01) (02) (03) (04)
2389
        (11) (12) (13) (14) (15) (16) (17) (18) (19) (20)
2390
        % (23)   % Reassigned to variable-length AI (235)!
2391
        (31) (32) (33) (34) (35) (36)
2392
        (41)
2393
    ] {dup} forall >> def
2394
} ctxdef
2395
 
2396
    /fncs [
2397
        ais {
2398
            true exch
2399
            dup length 2 ge {
2400
 
2401
            } {
2402
                pop
2403
            } ifelse
2404
        } forall
2405
    ] def
2406
 
2407
 
2408
    % Linter routines for validating AI components
2409
 
2410
    /lintnumeric {
2411
        true exch {
2412
            dup 48 lt exch 57 gt or { pop false exit } if
2413
        } forall
2414
        not { pop /bwipp.GS1notNumeric (Not numeric) false exit } if
2415
    } def
2416
 
2417
    /lintcset82 {
2418
        true exch {
2419
            1 string dup 0 4 -1 roll put
2420
            (!"%&'()*+,-./0123456789:;<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz)
2421
            exch search not { pop pop false exit } if
2422
            pop pop pop
2423
        } forall
2424
        not { pop /bwipp.GS1badCSET82character (Invalid CSET 82 character) false exit } if
2425
    } def
2426
 
2427
    /lintcset39 {
2428
        true exch {
2429
            1 string dup 0 4 -1 roll put
2430
            (#-/0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ)
2431
            exch search not { pop pop false exit } if
2432
            pop pop pop
2433
        } forall
2434
        not { pop /bwipp.GS1badCSET39character  (Invalid CSET 39 character) false exit } if
2435
    } def
2436
 
2437
    /lintkey {
2438
        dup length 2 lt { pop pop /bwipp.GS1keyTooShort (Key is too short) false exit } if
2439
        dup 0 get dup 48 lt exch 57 gt or exch
2440
        1 get dup 48 lt exch 57 gt or or {
2441
            pop /bwipp.GS1badGCP (Non-numeric company prefix) false exit
2442
        } if
2443
    } def
2444
 
2445
    /lintimporteridx {
2446
        (-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz)
2447
        exch search not {pop pop /bwipp.GS1badImporterIndex (Invalid importer index) false exit} if
2448
        pop pop pop
2449
    } def
2450
 
2451
    /lintcsum {
2452
        mark exch
2453
        dup length 2 mod 0 eq {3} {1} ifelse
2454
        exch { 48 sub 1 index mul exch 4 exch sub } forall pop
2455
 
2456
        10 mod 0 ne { pop /bwipp.GS1badChecksum (Bad checksum) false exit } if
2457
    } def
2458
 
2459
{
2460
    /cset82 <<
2461
 
2462
        { exch dup 1 add } forall pop
2463
    >> def
2464
 
2465
    /cset32 <<
2466
 
2467
        { exch dup 1 add } forall pop
2468
    >> def
2469
} ctxdef
2470
 
2471
    /lintcsumalpha {
2472
        dup length 2 lt { pop pop /bwipp.GS1alphaTooShort (Alphanumeric string is too short to check) false exit} if
2473
        dup length 2 sub
2474
        2 copy
2475
 
2476
            dup cset82 exch known { cset82 exch get } { -1 exit } ifelse
2477
        } forall
2478
        dup -1 eq { cleartomark pop pop pop /bwipp.GS1UnknownCSET82Character (Unknown CSET 82 character) false exit} if
2479
        counttomark array astore exch pop
2480
        3 1 roll
2481
        2 getinterval mark exch {
2482
            dup cset32 exch known { cset32 exch get } { -1 exit } ifelse
2483
        } forall
2484
        dup -1 eq { cleartomark pop pop /bwipp.GS1UnknownCSET32Character (Unknown CSET 32 character) false exit} if
2485
        counttomark array astore exch pop
2486
        dup 0 get 5 bitshift exch 1 get add exch
2487
        [ 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 ]
2488
        1 index length
2489
        dup 2 index length gt { pop pop pop pop pop /bwipp.GS1alphaTooLong (Alphanumeric string is too long to check) false exit} if
2490
 
2491
 
2492
        ne { pop /bwipp.GS1badAlphaCheckCharacters (Bad alphanumeric check characters) false exit} if
2493
    } def
2494
 
2495
{
2496
    /iso3166 << [
2497
        /004 /008 /010 /012 /016 /020 /024 /028 /031 /032 /036 /040 /044 /048
2498
        /050 /051 /052 /056 /060 /064 /068 /070 /072 /074 /076 /084 /086 /090 /092 /096
2499
        /100 /104 /108 /112 /116 /120 /124 /132 /136 /140 /144 /148
2500
        /152 /156 /158 /162 /166 /170 /174 /175 /178 /180 /184 /188 /191 /192 /196
2501
        /203 /204 /208 /212 /214 /218 /222 /226 /231 /232 /233 /234 /238 /239 /242 /246 /248
2502
        /250 /254 /258 /260 /262 /266 /268 /270 /275 /276 /288 /292 /296
2503
        /300 /304 /308 /312 /316 /320 /324 /328 /332 /334 /336 /340 /344 /348
2504
        /352 /356 /360 /364 /368 /372 /376 /380 /384 /388 /392 /398
2505
        /400 /404 /408 /410 /414 /417 /418 /422 /426 /428 /430 /434 /438 /440 /442 /446
2506
        /450 /454 /458 /462 /466 /470 /474 /478 /480 /484 /492 /496 /498 /499
2507
        /500 /504 /508 /512 /516 /520 /524 /528 /531 /533 /534 /535 /540 /548
2508
        /554 /558 /562 /566 /570 /574 /578 /580 /581 /583 /584 /585 /586 /591 /598
2509
        /600 /604 /608 /612 /616 /620 /624 /626 /630 /634 /638 /642 /643 /646
2510
        /652 /654 /659 /660 /662 /663 /666 /670 /674 /678 /682 /686 /688 /690 /694
2511
        /702 /703 /704 /705 /706 /710 /716 /724 /728 /729 /732 /740 /744 /748
2512
        /752 /756 /760 /762 /764 /768 /772 /776 /780 /784 /788 /792 /795 /796 /798
2513
        /800 /804 /807 /818 /826 /831 /832 /833 /834 /840
2514
        /850 /854 /858 /860 /862 /876 /882 /887 /894
2515
    ] {dup} forall >> def
2516
} ctxdef
2517
 
2518
    /lintiso3166 {
2519
        iso3166 exch known not { pop /bwipp.GS1UnknownCountry (Unknown country code) false exit } if
2520
    } def
2521
 
2522
    /lintiso3166999 {
2523
        dup /999 ne {
2524
            iso3166 exch known not { pop /bwipp.GS1UnknownCountryOr999 (Unknown country code or not 999) false exit } if
25039 craig 2525
        } {
25125 craig 2526
            pop
25039 craig 2527
        } ifelse
25125 craig 2528
    } def
25039 craig 2529
 
25125 craig 2530
    /lintiso3166list {
2531
        dup length 3 mod 0 ne {
2532
            pop pop /bwipp.GS1BadCountryListLength (Not a group of three-digit country codes) false exit
2533
        } if
2534
        true
2535
 
2536
            2 index exch 3 getinterval
2537
            iso3166 exch known not { pop pop false exit } if
2538
        } for
2539
        not { pop /bwipp.GS1UnknownCountry (Unknown country code) false exit } if
2540
        pop
2541
    } def
2542
 
2543
{
2544
    /iso3166alpha2 << [
2545
        /AD /AE /AF /AG /AI /AL /AM /AO /AQ /AR /AS /AT /AU /AW /AX /AZ
2546
        /BA /BB /BD /BE /BF /BG /BH /BI /BJ /BL /BM /BN /BO /BQ /BR /BS /BT /BV /BW /BY /BZ
2547
        /CA /CC /CD /CF /CG /CH /CI /CK /CL /CM /CN /CO /CR /CU /CV /CW /CX /CY /CZ
2548
        /DE /DJ /DK /DM /DO /DZ
2549
        /EC /EE /EG /EH /ER /ES /ET
2550
        /FI /FJ /FK /FM /FO /FR
2551
        /GA /GB /GD /GE /GF /GG /GH /GI /GL /GM /GN /GP /GQ /GR /GS /GT /GU /GW /GY
2552
        /HK /HM /HN /HR /HT /HU
2553
        /ID /IE /IL /IM /IN /IO /IQ /IR /IS /IT /JE /JM /JO /JP
2554
        /KE /KG /KH /KI /KM /KN /KP /KR /KW /KY /KZ
2555
        /LA /LB /LC /LI /LK /LR /LS /LT /LU /LV /LY
2556
        /MA /MC /MD /ME /MF /MG /MH /MK /ML /MM /MN /MO /MP /MQ /MR /MS /MT /MU /MV /MW /MX /MY /MZ
2557
        /NA /NC /NE /NF /NG /NI /NL /NO /NP /NR /NU /NZ
2558
        /OM
2559
        /PA /PE /PF /PG /PH /PK /PL /PM /PN /PR /PS /PT /PW /PY
2560
        /QA
2561
        /RE /RO /RS /RU /RW
2562
        /SA /SB /SC /SD /SE /SG /SH /SI /SJ /SK /SL /SM /SN /SO /SR /SS /ST /SV /SX /SY /SZ
2563
        /TC /TD /TF /TG /TH /TJ /TK /TL /TM /TN /TO /TR /TT /TV /TW /TZ
2564
        /UA /UG /UM /US /UY /UZ
2565
        /VA /VC /VE /VG /VI /VN /VU
2566
        /WF /WS
2567
        /YE /YT
2568
        /ZA /ZM /ZW
2569
    ] {dup} forall >> def
2570
} ctxdef
2571
 
2572
    /lintiso3166alpha2 {
2573
        iso3166alpha2 exch known not { pop /bwipp.GS1UnknownCountryAlpha (Unknown country alpha code) false exit } if
2574
    } def
2575
 
2576
{
2577
    /iso4217 << [
2578
        /008 /012 /032 /036 /044 /048
2579
        /050 /051 /052 /060 /064 /068 /072 /084 /090 /096
2580
        /104 /108 /116 /124 /132 /136 /144
2581
        /152 /156 /170 /174 /188 /191 /192
2582
        /203 /208 /214 /222 /230 /232 /238 /242 /262 /270 /292
2583
        /320 /324 /328 /332 /340 /344 /348
2584
        /352 /356 /360 /364 /368 /376 /388 /392 /398
2585
        /400 /404 /408 /410 /414 /417 /418
2586
        /422 /426 /430 /434 /446
2587
        /454 /458 /462 /480 /484 /496 /498
2588
        /504 /512 /516 /524 /532 /533 /548
2589
        /554 /558 /566 /578 /586 /590 /598
2590
        /600 /604 /608 /634 /643 /646 /654 /682 /690 /694
2591
        /702 /704 /706 /710 /728 /748
2592
        /752 /756 /760 /764 /776 /780 /784 /788
2593
        /800 /807 /818 /826 /834 /840 /858 /860 /882 /886
2594
        /901 /925 /927 /928 /929 /930 /931 /932 /933 /934 /936 /938
2595
        /940 /941 /943 /944 /946 /947 /948 /949
2596
        /950 /951 /952 /953 /955 /956 /957 /958 /959
2597
        /960 /961 /962 /963 /964 /965 /967 /968 /969
2598
        /970 /971 /972 /973 /975 /976 /977 /978 /979
2599
        /980 /981 /984 /985 /986 /990 /994 /997 /999
2600
    ] {dup} forall >> def
2601
} ctxdef
2602
 
2603
    /lintiso4217 {
2604
        iso4217 exch known not { pop /bwipp.GS1UnknownCurrency (Unknown currency code) false exit } if
2605
    } def
2606
 
2607
    /lintiban {
2608
        dup length 4 le { pop pop /bwipp.GS1tooShort (IBAN too short) false exit } if
2609
        dup true exch {
2610
            1 string dup 0 4 -1 roll put
2611
            (0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ)
2612
            exch search not { pop pop false exit } if
2613
            pop pop pop
2614
        } forall
2615
        not { pop /bwipp.GS1badIBANcharacter (Invalid IBAN character) false exit } if
2616
        dup mark exch mark exch {} forall counttomark -4 roll counttomark array astore exch pop {
2617
            48 sub dup 9 gt {7 sub dup 10 idiv exch 10 mod} if
2618
        } forall counttomark array astore exch pop
2619
 
2620
        1 ne { pop pop /bwipp.GS1badIBANchecksum (IBAN checksum incorrect) false exit } if
2621
 
2622
    } def
2623
 
2624
    /lintzero {
2625
        (0) ne { pop /bwipp.GS1zeroRequired (Zero is required) false exit } if
2626
    } def
2627
 
2628
    /lintnonzero {
2629
        false exch { 48 ne {pop true} if } forall
2630
        not { pop /bwipp.GS1zeroNotPermitted (Zero not permitted) false exit } if
2631
    } def
2632
 
2633
    /lintnozeroprefix {
2634
        dup length 1 gt exch 0 get 48 eq and {
2635
            pop /bwipp.GS1badZeroPrefix (Zero prefix is not permitted) false exit
2636
        } if
2637
    } def
2638
 
2639
    /lintyymmd0 {
2640
        dup 2 2 getinterval cvi dup 1 lt exch 12 gt or { pop /bwipp.GS1badMonth (Invalid month) false exit } if
2641
        dup 0 2 getinterval cvi dup  21  sub  % Update 20YY periodically for century calculation
2642
        dup 51 ge {pop 1900 add} { -50 le {2100 add} {2000 add} ifelse} ifelse  % YYYY
2643
        dup 400 mod 0 eq exch dup 4 mod 0 eq exch 100 mod 0 ne and or           % Leap year?
2644
        [ 31  3 -1 roll {29} {28} ifelse  31 30 31 30 31 31 30 31 30 31 ]
2645
        1 index 2 2 getinterval cvi 1 sub get
2646
        exch 4 2 getinterval cvi lt { pop /bwipp.GS1badDay (Invalid day of month) false exit } if
2647
    } def
2648
 
2649
    /lintyymmdd {
2650
        dup length 6 ne { pop /bwipp.GS1badDateLength (Invalid length for date) false exit } if
2651
        dup 4 2 getinterval cvi 1 lt { pop /bwipp.GS1badDay (Invalid day of month) false exit } if
2652
        lintyymmd0
2653
    } def
2654
 
2655
    /lintyymmddhh {
2656
        dup length 8 ne { pop /bwipp.GS1badYYMMDDHHLength (Invalid length for date with hour) false exit } if
2657
        dup 6 2 getinterval cvi 23 gt { pop pop /bwipp.GS1badHour (Invalid hour of day) false exit } if
2658
 
2659
    } def
2660
 
2661
    /linthhmm {
2662
        dup 0 2 getinterval cvi 23 gt { pop pop /bwipp.GS1badHour (Invalid hour of day) false exit } if
2663
        2 2 getinterval cvi 59 gt { pop /bwipp.GS1badMinute (Invalid minute in the hour) false exit } if
2664
    } def
2665
 
2666
    /lintmmoptss {
2667
        dup length dup 2 ne exch 4 ne and {
2668
            pop /bwipp.GS1badTimeLength (Invalid length for optional minutes and seconds) false exit
2669
        } if
2670
        dup 0 2 getinterval cvi 59 gt { pop pop /bwipp.GS1badMinute (Invalid minute in the hour) false exit } if
2671
        dup length 4 ge {
2672
            dup 2 2 getinterval cvi 59 gt { pop pop /bwipp.GS1badSecond (Invalid second in the minute) false exit } if
2673
        } if
2674
        pop
2675
    } def
2676
 
2677
    /lintyesno {
2678
        dup (0) ne exch (1) ne and {
2679
            pop /bwipp.GS1badBoolean (Neither 0 nor 1 for yes or no) false exit
2680
        } if
2681
    } def
2682
 
2683
    /lintwinding {
2684
        dup (0) ne exch dup (1) ne exch (9) ne and and {
2685
            pop /bwipp.GS1badWinding (Invalid winding direction) false exit
2686
        } if
2687
    } def
2688
 
2689
    /lintpieceoftotal {
2690
        dup length 2 mod 0 ne { pop pop /bwipp.GS1badPieceTotalLength (Invalid piece/total length) false exit } if
2691
        dup dup length 2 idiv 0 exch getinterval cvi
2692
        dup 0 eq { pop pop pop /bwipp.GS1badPieceNumber (Invalid piece number) false exit } if
2693
        exch dup length 2 idiv dup getinterval cvi
2694
        dup 0 eq { pop pop pop /bwipp.GS1badPieceTotal (Invalid total number) false exit } if
2695
        gt { pop /bwipp.GS1pieceExceedsTotal (Piece number exceeds total) false exit } if
2696
    } def
2697
 
2698
    /lintpcenc {
2699
        {
2700
            (%) search not {pop exit} if
2701
            pop pop dup length 2 lt { pop pop /bwipp.GS1badPercentEscape (Invalid % escape) false exit } if
2702
            dup 0 2 getinterval true exch {
2703
                1 string dup 0 4 -1 roll put
2704
                (0123456789ABCDEFabcdef)
2705
                exch search not { pop pop false exit } if
2706
                pop pop pop
2707
            } forall
2708
            not { pop pop /bwipp.GS1badPercentChars (Invalid characters for percent encoding) false exit } if
2709
        } loop
2710
    } bind def
2711
 
2712
    /lintcouponcode {
2713
        dup true exch {
2714
            dup 48 lt exch 57 gt or { pop false exit } if
2715
        } forall
2716
        not { pop pop /bwipp.GS1couponNotNumeric (Coupon not numeric) false exit } if
2717
 
2718
        % GCP VLI and value
2719
        dup length 1 lt {
2720
            pop pop /bwipp.GS1couponTooShortGCPVLI (Coupon too short: Missing GCP VLI) false exit
2721
        } if
2722
        dup 0 1 getinterval cvi dup 6 gt {
2723
            pop pop /bwipp.GS1couponBadGCPVLI (Coupon GCP length indicator must be 0-6) false exit
2724
        } if
2725
        6 add 1 add
2726
        2 copy exch length gt {
2727
            pop pop pop /bwipp.GS1couponTooShortGCP (Coupon too short: GCP truncated) false exit
2728
        } if
2729
        dup 2 index length exch sub getinterval
2730
 
2731
        % Offer Code
2732
        dup length 6 lt {
2733
            pop pop /bwipp.GS1couponTooShortOfferCode (Coupon too short: Offer Code truncated) false exit
2734
        } if
2735
        dup length 6 sub 6 exch getinterval
2736
 
2737
        % Save Value VLI and value
2738
        dup length 1 lt {
2739
            pop pop /bwipp.GS1couponTooShortSaveValueVLI (Coupon too short: Missing Save Value VLI) false exit
2740
        } if
2741
        dup 0 1 getinterval cvi dup dup 1 lt exch 5 gt or {
2742
            pop pop /bwipp.GS1couponBadSaveValueVLI (Coupon Save Value length indicator must be 1-5) false exit
2743
        } if
2744
        1 add
2745
        2 copy exch length gt {
2746
            pop pop pop /bwipp.GS1couponTooShortSaveValue (Coupon too short: Save Value truncated) false exit
2747
        } if
2748
        dup 2 index length exch sub getinterval
2749
 
2750
        % 1st Purchase Requirement VLI and value
2751
        dup length 1 lt {
2752
            pop pop /bwipp.GS1couponTooShort1stPurchaseRequirementVLI (Coupon too short: Missing 1st Purchase Requirement VLI) false exit
2753
        } if
2754
        dup 0 1 getinterval cvi dup dup 1 lt exch 5 gt or {
2755
            pop pop /bwipp.GS1couponBad1stPurchaseRequirementVLI (Coupon 1st Purchase Requirement length indicator must be 1-5) false exit
2756
        } if
2757
        1 add
2758
        2 copy exch length gt {
2759
            pop pop pop /bwipp.GS1couponTooShort1stPurchaseRequirement (Coupon too short: 1st Purchase Requirement truncated) false exit
2760
        } if
2761
        dup 2 index length exch sub getinterval
2762
 
2763
        % 1st Purchase Requirement Code
2764
        dup length 1 lt {
2765
            pop pop /bwipp.GS1couponTooShort1stPurchaseRequirementCode (Coupon too short: Missing 1st Purchase Requirement Code) false exit
2766
        } if
2767
        dup 0 1 getinterval cvi dup 4 gt exch 9 ne and {
2768
            pop pop /bwipp.GS1couponBad1stPurchaseRequirementCode (Coupon 1st Purchase Requirement Code must be 0-4 or 9) false exit
2769
        } if
2770
        dup length 1 sub 1 exch getinterval
2771
 
2772
        % 1st Purchase Family Code
2773
        dup length 3 lt {
2774
            pop pop /bwipp.GS1couponTooShort1stPurchaseFamilyCode (Coupon too short: 1st Purchase Family Code truncated) false exit
2775
        } if
2776
        dup length 3 sub 3 exch getinterval
2777
 
2778
        % Optional field 1
2779
        dup length 1 ge { dup 0 1 getinterval cvi 1 eq {
2780
            1 dup 2 index length exch sub getinterval
2781
 
2782
            % Additional Purchase Rules Code
2783
            dup length 1 lt {
2784
                pop pop /bwipp.GS1couponTooShortAdditionalPurchaseRulesCode (Coupon too short: Missing Additional Purchase Rules Code) false exit
2785
            } if
2786
            dup 0 1 getinterval cvi 3 gt {
2787
                pop pop /bwipp.GS1couponBadAdditionalPurchaseRulesCode (Coupon Additional Purchase Rules Code must be 0-3) false exit
2788
            } if
2789
            dup length 1 sub 1 exch getinterval
2790
 
2791
            % 2nd Purchase RequirementVLI and value
2792
            dup length 1 lt {
2793
                pop pop /bwipp.GS1couponTooShort2ndPurchaseRequirementVLI (Coupon too short: Missing 2nd Purchase Requirement VLI) false exit
2794
            } if
2795
            dup 0 1 getinterval cvi dup dup 1 lt exch 5 gt or {
2796
                pop pop /bwipp.GS1couponBad2ndPurchaseRequirementVLI (Coupon 2nd Purchase Requirement length indicator must be 1-5) false exit
2797
            } if
2798
            1 add
2799
            2 copy exch length gt {
2800
                pop pop pop /bwipp.GS1couponTooShort2ndPurchaseRequirement (Coupon too short: 2nd Purchase Requirement truncated) false exit
2801
            } if
2802
            dup 2 index length exch sub getinterval
2803
 
2804
            % 2nd Purchase Requirement Code
2805
            dup length 1 lt {
2806
                pop pop /bwipp.GS1couponTooShort2ndPurchaseRequirementCode (Coupon too short: Missing 2nd Purchase Requirement Code) false exit
2807
            } if
2808
            dup 0 1 getinterval cvi dup 4 gt exch 9 ne and {
2809
                pop pop /bwipp.GS1couponBad2ndPurchaseRequirementCode (Coupon 2nd Purchase Requirement Code must be 0-4 or 9) false exit
2810
            } if
2811
            dup length 1 sub 1 exch getinterval
2812
 
2813
            % 2nd Purchase Family Code
2814
            dup length 3 lt {
2815
                pop pop /bwipp.GS1couponTooShort2ndPurchaseFamilyCode (Coupon too short: 2nd Purchase Family Code truncated) false exit
2816
            } if
2817
            dup length 3 sub 3 exch getinterval
2818
 
2819
            % 2nd Purchase GCP VLI and value
2820
            dup length 1 lt {
2821
                pop pop /bwipp.GS1couponTooShort2ndPurchaseGCPVLI (Coupon too short: Missing 2nd Purchase GCP VLI) false exit
2822
            } if
2823
            dup 0 1 getinterval cvi dup dup 6 gt exch 9 ne and {
2824
                pop pop /bwipp.GS1couponBad2ndPurchaseGCPVLI (Coupon 2nd Purchase GCP length indicator must be 0-6 or 9) false exit
2825
            } if
2826
            dup 9 ne {6 add} {pop 0} ifelse 1 add
2827
            2 copy exch length gt {
2828
                pop pop pop /bwipp.GS1couponTooShort2ndPurchaseGCP (Coupon too short: 2nd Purchase GCP truncated) false exit
2829
            } if
2830
            dup 2 index length exch sub getinterval
2831
 
2832
        } if } if
2833
 
2834
        % Optional field 2
2835
        dup length 1 ge { dup 0 1 getinterval cvi 2 eq {
2836
            1 dup 2 index length exch sub getinterval
2837
 
2838
            % 3rd Purchase RequirementVLI and value
2839
            dup length 1 lt {
2840
                pop pop /bwipp.GS1couponTooShort3rdPurchaseRequirementVLI (Coupon too short: Missing 3rd Purchase Requirement VLI) false exit
2841
            } if
2842
            dup 0 1 getinterval cvi dup dup 1 lt exch 5 gt or {
2843
                pop pop /bwipp.GS1couponBad3rdPurchaseRequirementVLI (Coupon 3rd Purchase Requirement length indicator must be 1-5) false exit
2844
            } if
2845
            1 add
2846
            2 copy exch length gt {
2847
                pop pop pop /bwipp.GS1couponTooShort3rdPurchaseRequirement (Coupon too short: 3rd Purchase Requirement truncated) false exit
2848
            } if
2849
            dup 2 index length exch sub getinterval
2850
 
2851
            % 3rd Purchase Requirement Code
2852
            dup length 1 lt {
2853
                pop pop /bwipp.GS1couponTooShort3rdPurchaseRequirementCode (Coupon too short: Missing 3rd Purchase Requirement Code) false exit
2854
            } if
2855
            dup 0 1 getinterval cvi dup 4 gt exch 9 ne and {
2856
                pop pop /bwipp.GS1couponBad3rdPurchaseRequirementCode (Coupon 3rd Purchase Requirement Code must be 0-4 or 9) false exit
2857
            } if
2858
            dup length 1 sub 1 exch getinterval
2859
 
2860
            % 3rd Purchase Family Code
2861
            dup length 3 lt {
2862
                pop pop /bwipp.GS1couponTooShort3rdPurchaseFamilyCode (Coupon too short: 3rd Purchase Family Code truncated) false exit
2863
            } if
2864
            dup length 3 sub 3 exch getinterval
2865
 
2866
            % 3rd Purchase GCP VLI and value
2867
            dup length 1 lt {
2868
                pop pop /bwipp.GS1couponTooShort3rdPurchaseGCPVLI (Coupon too short: Missing 3rd Purchase GCP VLI) false exit
2869
            } if
2870
            dup 0 1 getinterval cvi dup dup 6 gt exch 9 ne and {
2871
                pop pop /bwipp.GS1couponBad3rdPurchaseGCPVLI (Coupon 3rd Purchase GCP length indicator must be 0-6 or 9) false exit
2872
            } if
2873
            dup 9 ne {6 add} {pop 0} ifelse 1 add
2874
            2 copy exch length gt {
2875
                pop pop pop /bwipp.GS1couponTooShort3rdPurchaseGCP (Coupon too short: 3rd Purchase GCP truncated) false exit
2876
            } if
2877
            dup 2 index length exch sub getinterval
2878
 
2879
        } if } if
2880
 
2881
        % Optional field 3
2882
        /couponexpire -1 def
2883
        dup length 1 ge { dup 0 1 getinterval cvi 3 eq {
2884
            1 dup 2 index length exch sub getinterval
2885
 
2886
            % Expiration date
2887
            dup length 6 lt {
2888
                pop pop /bwipp.GS1couponTooShortExpirationDate (Coupon too short: Expiration date) false exit
2889
            } if
2890
            dup 2 2 getinterval cvi dup 1 lt exch 12 gt or { pop pop /bwipp.GS1couponExpirationDateBadMonth (Invalid month in expiration date) false exit } if
2891
            dup 0 2 getinterval cvi dup 21 sub  % Update 20YY periodically for century calculation
2892
            dup 51 ge {pop 1900 add} { -50 le {2100 add} {2000 add} ifelse} ifelse  % YYYY
2893
            dup 400 mod 0 eq exch dup 4 mod 0 eq exch 100 mod 0 ne and or           % Leap year?
2894
            [ 31  3 -1 roll {29} {28} ifelse  31 30 31 30 31 31 30 31 30 31 ]
2895
            1 index 2 2 getinterval cvi 1 sub get
2896
            1 index 4 2 getinterval cvi dup 3 1 roll lt
2897
            exch 1 lt or { pop pop /bwipp.GS1couponExpirationDateBadDay (Invalid day of month in expiration date) false exit } if
2898
            dup 0 6 getinterval cvi /couponexpire exch def
2899
            dup length 6 sub 6 exch getinterval
2900
 
2901
        } if } if
2902
 
2903
        % Optional field 4
2904
        dup length 1 ge { dup 0 1 getinterval cvi 4 eq {
2905
            1 dup 2 index length exch sub getinterval
2906
 
2907
            % Start date
2908
            dup length 6 lt {
2909
                pop pop /bwipp.GS1couponTooShortStartDate (Coupon too short: Start date) false exit
2910
            } if
2911
            dup 2 2 getinterval cvi dup 1 lt exch 12 gt or { pop pop /bwipp.GS1couponStartDateBadMonth (Invalid month in start date) false exit } if
2912
            dup 0 2 getinterval cvi dup 21 sub  % Update 20YY periodically for century calculation
2913
            dup 51 ge {pop 1900 add} { -50 le {2100 add} {2000 add} ifelse} ifelse  % YYYY
2914
            dup 400 mod 0 eq exch dup 4 mod 0 eq exch 100 mod 0 ne and or           % Leap year?
2915
            [ 31  3 -1 roll {29} {28} ifelse  31 30 31 30 31 31 30 31 30 31 ]
2916
            1 index 2 2 getinterval cvi 1 sub get
2917
            1 index 4 2 getinterval cvi dup 3 1 roll lt
2918
            exch 1 lt or { pop pop /bwipp.GS1couponStartDateBadDay (Invalid day of month in start date) false exit } if
2919
            dup 0 6 getinterval cvi /couponstart exch def
2920
            couponexpire -1 ne couponexpire couponstart lt and {
2921
                pop pop /bwipp.GS1couponExpireDateBeforeStartDate (Coupon expires before it starts) false exit
2922
            } if
2923
            dup length 6 sub 6 exch getinterval
2924
 
2925
        } if } if
2926
 
2927
        % Optional field 5
2928
        dup length 1 ge { dup 0 1 getinterval cvi 5 eq {
2929
            1 dup 2 index length exch sub getinterval
2930
 
2931
            % Serial Number VLI and value
2932
            dup length 1 lt {
2933
                pop pop /bwipp.GS1couponTooShortSerialNumberVLI (Coupon too short: Missing Serial Number VLI) false exit
2934
            } if
2935
            dup 0 1 getinterval cvi 6 add 1 add
2936
            2 copy exch length gt {
2937
                pop pop pop /bwipp.GS1couponTooShortSerialNumber (Coupon too short: Serial Number truncated) false exit
2938
            } if
2939
            dup 2 index length exch sub getinterval
2940
 
2941
        } if } if
2942
 
2943
        % Optional field 6
2944
        dup length 1 ge { dup 0 1 getinterval cvi 6 eq {
2945
            1 dup 2 index length exch sub getinterval
2946
 
2947
            % Retailer GCP/GLN VLI and value
2948
            dup length 1 lt {
2949
                pop pop /bwipp.GS1couponTooShortRetailerGCPGLNVLI (Coupon too short: Missing Retailer GCP/GLN VLI) false exit
2950
            } if
2951
            dup 0 1 getinterval cvi dup dup 1 lt exch 7 gt or {
2952
                pop pop /bwipp.GS1couponBadRetailerGCPGLNVLI (Coupon Retailer GCP/GLN length indicator must be 1-7) false exit
2953
            } if
2954
            6 add 1 add
2955
            2 copy exch length gt {
2956
                pop pop pop /bwipp.GS1couponTooShortRetailerGCPGLN (Coupon too short: Retailer GCP/GLN truncated) false exit
2957
            } if
2958
            dup 2 index length exch sub getinterval
2959
 
2960
        } if } if
2961
 
2962
        % Optional field 9
2963
        dup length 1 ge { dup 0 1 getinterval cvi 9 eq {
2964
            1 dup 2 index length exch sub getinterval
2965
 
2966
            % Save Value Code
2967
            dup length 1 lt {
2968
                pop pop /bwipp.GS1couponTooShortSaveValueCode (Coupon too short: Missing Save Value Code) false exit
2969
            } if
2970
            dup 0 1 getinterval cvi dup 6 gt exch dup 3 eq exch 4 eq or or {
2971
                pop pop /bwipp.GS1couponBadSaveValueCode (Coupon Save Value Code must be 0,1,2,5 or 6) false exit
2972
            } if
2973
            dup length 1 sub 1 exch getinterval
2974
 
2975
            % Save Value Applies to Item
2976
            dup length 1 lt {
2977
                pop pop /bwipp.GS1couponTooShortSaveValueAppliesToItem (Coupon too short: Missing Save Value Applies to Item) false exit
2978
            } if
2979
            dup 0 1 getinterval cvi 2 gt {
2980
                pop pop /bwipp.GS1couponBadSaveValueAppliesToItem (Coupon Save Value Applies to Item must be 0-2) false exit
2981
            } if
2982
            dup length 1 sub 1 exch getinterval
2983
 
2984
            % Store Coupon Flag
2985
            dup length 1 lt {
2986
                pop pop /bwipp.GS1couponTooShortStoreCouponFlag (Coupon too short: Missing Store Coupon Flag) false exit
2987
            } if
2988
            dup length 1 sub 1 exch getinterval
2989
 
2990
            % Don't Multiply Flag
2991
            dup length 1 lt {
2992
                pop pop /bwipp.GS1couponTooShortDontMultiplyFlag (Coupon too short: Missing Don't Multiply Flag) false exit
2993
            } if
2994
            dup 0 1 getinterval cvi 1 gt {
2995
                pop pop /bwipp.GS1couponBadDontMultiplyFlag (Don't Multiply Flag must be 0 or 1) false exit
2996
            } if
2997
            dup length 1 sub 1 exch getinterval
2998
 
2999
        } if } if
3000
 
3001
        dup length 0 ne {
3002
            pop pop /bwipp.GS1couponUnrecognisedOptionalField (Coupon fields must be 1,2,3,4,5,6 or 9, increasing order) false exit
3003
        } if
3004
        pop
3005
    } def
3006
 
3007
    /lintcouponposoffer {
3008
        dup true exch {
3009
            dup 48 lt exch 57 gt or { pop false exit } if
3010
        } forall
3011
        not { pop pop /bwipp.GS1couponNotNumeric (Coupon not numeric) false exit } if
3012
        % Format Code
3013
        dup length 1 lt {
3014
            pop pop /bwipp.GS1couponTooShortFormatCode (Coupon too short: Missing Format Code) false exit
3015
        } if
3016
        dup 0 1 getinterval dup (0) ne exch (1) ne and {
3017
            pop pop /bwipp.GS1couponBadFormatCode (Coupon format must be 0 or 1) false exit
3018
        } if
3019
        dup length 1 sub 1 exch getinterval
3020
        % Funder ID VLI and Funder ID
3021
        dup length 1 lt {
3022
            pop pop /bwipp.GS1couponTooShortFunderVLI (Coupon too short: Missing Funder VLI) false exit
3023
        } if
3024
        dup 0 1 getinterval cvi dup 6 gt {
3025
            pop pop pop /bwipp.GS1couponBadFunderVLI (Coupon Funder length indicator must be 0-6) false exit
3026
        } if
3027
        6 add 1 add
3028
        2 copy exch length gt {
3029
            pop pop pop /bwipp.GS1couponTooShortFunder (Coupon too short: Truncated Funder ID) false exit
3030
        } if
3031
        dup 2 index length exch sub getinterval
3032
        % Offer Code
3033
        dup length 6 lt {
3034
            pop pop /bwipp.GS1couponTooShortOfferCode (Coupon too short: Truncated Offer Code) false exit
3035
        } if
3036
        dup length 6 sub 6 exch getinterval
3037
        % Serial Number VLI and Serial Number
3038
        dup length 1 lt {
3039
            pop pop /bwipp.GS1couponTooShortSnVLI (Coupon too short: Missing SN VLI) false exit
3040
        } if
3041
        dup 0 1 getinterval cvi
3042
        6 add 1 add
3043
        2 copy exch length gt {
3044
            pop pop pop /bwipp.GS1couponTooShortSn (Coupon too short: Truncated SN) false exit
3045
        } if
3046
        dup 2 index length exch sub getinterval
3047
        dup length 0 ne {
3048
            pop pop /bwipp.GS1couponTooLong (Coupon too long) false exit
3049
        } if
3050
        pop
3051
    } def
3052
 
3053
    /lintlatlong {
3054
        dup length 20 ne {
3055
            pop /bwipp.GS1badGeoLength (Invalid length for a geo-location) false exit
3056
        } if
3057
        dup  0 10 getinterval cvi 1800000000 gt { pop /bwipp.GS1badLatitude (Invalid value for latitude) false exit } if
3058
        dup 10 10 getinterval cvi 3600000000 gt { pop /bwipp.GS1badLongitude (Invalid value for longitude) false exit } if
3059
        pop
3060
    } def
3061
 
3062
    dontlint not {
3063
 
3064
        % Validate AI contents
3065
        true
3066
 
3067
            dup ais exch get /ai exch def
3068
            vals exch get /val exch def
3069
            gs1syntax ai known {
3070
                gs1syntax ai get /parts get
3071
                % Overall length checks, e.g. to report "too long", not "checksum failure"
3072
                dup 0 exch {dup /opt get {pop 0} {/min get} ifelse add} forall val length gt {
3073
                    pop /bwipp.GS1valueTooShort (Too short) false exit
3074
                } if
3075
                dup 0 exch {/max get add} forall val length lt {
3076
                    pop /bwipp.GS1valueTooLong (Too long) false exit
3077
                } if
3078
                {  % Checks for each component of the AI
3079
                    /props exch def
3080
                    props /max get val length 2 copy gt {exch} if pop
3081
                    val exch 0 exch getinterval /eval exch def
3082
                    /val val eval length dup val length exch sub getinterval def
3083
                    eval length 0 eq {
3084
                        props /opt get not {
3085
                            pop /bwipp.GS1valueTooShort (Too short) false exit
3086
                        } if
3087
                    } {
3088
                        eval length props /min get lt {
3089
                            pop /bwipp.GS1valueTooShort (Too short) false exit
3090
                        } if
3091
                        << /N /lintnumeric  /X /lintcset82  /Y /lintcset39 >> props /cset get get eval exch load exec
3092
                        props /linters get { eval exch load exec } forall
3093
                    } ifelse
3094
                } forall
3095
                dup not {exit} if
3096
                val length 0 ne {  % Not all data consumed by components
3097
                    pop /bwipp.GS1valueTooLong (Too long) false exit
3098
                } if
3099
            } {
3100
                pop /bwipp.GS1unknownAI (Unrecognised AI) false exit
3101
            } ifelse
3102
        } for
3103
        not {
3104
            dup length ai length add 5 add string
3105
            dup 0 (AI ) putinterval
3106
            dup 3 ai putinterval
3107
            dup 3 ai length add (: ) putinterval
3108
            dup 5 ai length add 4 -1 roll putinterval
3109
            //raiseerror exec
3110
        } if
3111
 
3112
        % Search for "patt" matching an AIs, excluding "this" AI
3113
        /aiexists {
3114
            /this exch def
3115
            /patt exch def
3116
            1 {  % common exit
3117
                aivals patt known {true exit} if  % Fast path
3118
                patt length 4 eq {
3119
                    patt 3 1 getinterval (n) eq {
3120
                        /pfxlen patt 2 1 getinterval (n) eq {2} {3} ifelse def
3121
                        false
3122
                        ais {
3123
                            dup dup this ne exch length 4 eq and {
3124
 
3125
                                    pop true
3126
                                } if
3127
                            } {
3128
                                pop
3129
                            } ifelse
3130
                        } forall
3131
                        exit
3132
                    } if
3133
                    false exit
3134
                } if
3135
                false exit
3136
            } repeat
3137
        } def
3138
 
3139
        % Build AI dict and validate repeats
3140
        /aivals vals length dict def
3141
 
3142
            dup ais exch get /ai exch def
3143
            vals exch get /val exch def
3144
            aivals ai known {
3145
                aivals ai get val ne {
3146
                    ai length 40 add string
3147
                    dup 0 (Repeated AIs \() putinterval
3148
                    dup 14 ai putinterval
3149
                    dup 14 ai length add (\) must have the same value) putinterval
3150
                    /bwipp.GS1repeatedDifferingAIs exch //raiseerror exec
3151
                } if
3152
            } {
3153
                aivals ai val put
3154
            } ifelse
3155
        } for
3156
 
3157
        % Validate ex and req pairings
3158
 
3159
            ais exch get /ai exch def
3160
            gs1syntax ai get /ex 2 copy known {
3161
                get {
3162
                    /patt exch def
3163
                    patt ai aiexists {
3164
                        ai length patt length add 36 add string
3165
                        dup 0 (AIs \() putinterval
3166
                        dup 5 ai putinterval
3167
                        dup 5 ai length add (\) and \() putinterval
3168
                        dup 12 ai length add patt putinterval
3169
                        dup 12 ai length add patt length add (\) are mutually exclusive) putinterval
3170
                        /bwipp.GS1exclusiveAIs exch //raiseerror exec
3171
                    } if
3172
                } forall
3173
            } {
3174
                pop pop
3175
            } ifelse
3176
            lintreqs {
3177
                gs1syntax ai get /req 2 copy known {
3178
                    get {  % For each req attribute group
3179
                        false exch {  % Any req AI in the group is fine
3180
                            ai aiexists {pop true} if
3181
                        } forall
3182
                        not {
3183
                            ai length 47 add string
3184
                            dup 0 (One of more requisite AIs for AI \() putinterval
3185
                            dup 34 ai putinterval
3186
                            dup 34 ai length add (\) are missing) putinterval
3187
                            /bwipp.GS1missingAIs exch //raiseerror exec
3188
                        } if
3189
                    } forall
3190
                } {
3191
                    pop pop
3192
                } ifelse
3193
            } if
3194
        } for
3195
 
3196
    } if  % dontlint
3197
 
3198
    ais vals fncs
3199
 
3200
    //unloadctx exec
3201
 
25039 craig 3202
    end
3203
 
3204
}
3205
[/barcode] {null def} forall
3206
bind def
25125 craig 3207
/gs1process dup load /uk.co.terryburton.bwipp defineresource pop
25039 craig 3208
end
3209
/setpacking where {pop setpacking} if
3210
%%EndData
3211
%%EndResource
25125 craig 3212
% --END RESOURCE gs1process--
25039 craig 3213
 
13293 subik 3214
% --BEGIN RENDERER renlinear--
18800 fschmid 3215
% --REQUIRES preamble raiseerror--
25125 craig 3216
%%BeginResource: uk.co.terryburton.bwipp renlinear 0.0 2022072900 75424 74734
3217
%%BeginData:        246 ASCII Lines
16255 fschmid 3218
/setpacking where {pop currentpacking true setpacking} if
25125 craig 3219
10 dict
18800 fschmid 3220
dup /raiseerror dup /uk.co.terryburton.bwipp findresource put
16255 fschmid 3221
begin
13293 subik 3222
/renlinear {
3223
 
20313 craig 3224
    20 dict begin          % Confine variables to local scope
13293 subik 3225
 
20313 craig 3226
    /args exch def   % We are given some arguments
13293 subik 3227
 
20313 craig 3228
    % Default options
3229
    /sbs [] def
3230
    /bhs [] def
3231
    /bbs [] def
3232
    /txt [] def
3233
    /barcolor (unset) def
3234
    /includetext false def
3235
    /textcolor (unset) def
3236
    /textxalign (unset) def
3237
    /textyalign (unset) def
3238
    /textfont (Courier) def
3239
    /textsize 10 def
3240
    /textxoffset 0 def
3241
    /textyoffset 0 def
3242
    /textgaps 0 def
3243
    /alttext () def
3244
    /bordercolor (unset) def
3245
    /backgroundcolor (unset) def
3246
    /inkspread 0.15 def
3247
    /width 0 def
3248
    /barratio 1 def
3249
    /spaceratio 1 def
3250
    /showborder false def
3251
    /borderleft 10 def
3252
    /borderright 10 def
3253
    /bordertop 1 def
3254
    /borderbottom 1 def
3255
    /borderwidth 0.5 def
3256
    /guardwhitespace false def
3257
    /guardleftpos 0 def
3258
    /guardleftypos 0 def
3259
    /guardrightpos 0 def
3260
    /guardrightypos 0 def
3261
    /guardwidth 6 def
3262
    /guardheight 7 def
25039 craig 3263
 
20313 craig 3264
    % Apply the renderer options and the user options
3265
    args {def} forall
25039 craig 3266
    opt {def} forall
13293 subik 3267
 
20313 craig 3268
    /barcolor barcolor cvlit def
3269
    /textcolor textcolor cvlit def
3270
    /textxalign textxalign cvlit def
3271
    /textyalign textyalign cvlit def
3272
    /textfont textfont cvlit def
3273
    /textsize textsize cvr def
3274
    /textxoffset textxoffset cvr def
3275
    /textyoffset textyoffset cvr def
3276
    /textgaps textgaps cvr def
3277
    /alttext alttext cvlit def
3278
    /bordercolor bordercolor cvlit def
3279
    /backgroundcolor backgroundcolor cvlit def
3280
    /inkspread inkspread cvr def
3281
    /width width cvr def
3282
    /barratio barratio cvr def
3283
    /spaceratio spaceratio cvr def
3284
    /borderleft borderleft cvr def
3285
    /borderright borderright cvr def
3286
    /bordertop bordertop cvr def
3287
    /borderbottom borderbottom cvr def
3288
    /borderwidth borderwidth cvr def
3289
    /guardleftpos guardleftpos cvr def
3290
    /guardleftypos guardleftypos cvr def
3291
    /guardrightpos guardrightpos cvr def
3292
    /guardrightypos guardrightypos cvr def
3293
    /guardwidth guardwidth cvr def
3294
    /guardheight guardheight cvr def
25039 craig 3295
 
20313 craig 3296
    % Create bar elements and put them into the bars array
3297
    /bars sbs length 1 add 2 idiv array def
25125 craig 3298
    /pixx 0 def /pixy 0 def
20313 craig 3299
 
3300
        /i exch def
3301
        i 2 mod 0 eq {           % i is even
25125 craig 3302
            /d sbs i get barratio mul barratio sub 1 add def  % d = digit*r-r+1
20313 craig 3303
            sbs i get 0 ne {
3304
                /h bhs i 2 idiv get 72 mul def  % Height from bhs
25125 craig 3305
                /c d 2 div pixx add def         % Centre of the bar = pixx + d/2
20313 craig 3306
                /y bbs i 2 idiv get 72 mul def  % Baseline from bbs
3307
                /w d inkspread sub def          % bar width = digit - inkspread
3308
                bars i 2 idiv [h c y w] put     % Add the bar entry
25125 craig 3309
                h y add pixy gt {/pixy h y add def} if
20313 craig 3310
            } {
3311
                bars i 2 idiv -1 put            % Dummy entry
3312
            } ifelse
3313
        } {
25125 craig 3314
            /d sbs i get spaceratio mul spaceratio sub 1 add def  % d = digit*r-r+1
20313 craig 3315
        } ifelse
25125 craig 3316
        /pixx pixx d add def  % pixx += d
20313 craig 3317
    } for
13293 subik 3318
 
20313 craig 3319
    gsave
13293 subik 3320
 
20313 craig 3321
    currentpoint translate
13293 subik 3322
 
20313 craig 3323
    % Force symbol to given width
3324
    width 0 ne {
25125 craig 3325
        width 72 mul pixx div 1 scale
20313 craig 3326
    } if
13293 subik 3327
 
20313 craig 3328
    % Set RGB or CMYK color depending on length of given hex string
3329
    /setanycolor {
3330
        /anycolor exch def
3331
        anycolor length 6 eq {
3332
            (<      >) 8 string copy dup 1 anycolor putinterval cvx exec {255 div} forall setrgbcolor
3333
        } if
3334
        anycolor length 8 eq {
3335
            (<        >) 10 string copy dup 1 anycolor putinterval cvx exec {255 div} forall setcmykcolor
3336
        } if
3337
    } bind def
13293 subik 3338
 
20313 craig 3339
    % Display the border and background
3340
    newpath
3341
    borderleft neg borderbottom neg moveto
25125 craig 3342
    pixx borderleft add borderright add 0 rlineto
3343
 
3344
    pixx borderleft add borderright add neg 0 rlineto
3345
 
20313 craig 3346
    closepath
25039 craig 3347
    backgroundcolor (unset) ne { gsave backgroundcolor setanycolor fill grestore } if
20313 craig 3348
    showborder {
3349
        gsave
3350
        bordercolor (unset) ne { bordercolor setanycolor } if
3351
        borderwidth setlinewidth stroke
3352
        grestore
25039 craig 3353
    } if
3354
 
20313 craig 3355
    % Display the bars for elements in the bars array
3356
    gsave
3357
    barcolor (unset) ne { barcolor setanycolor } if
25125 craig 3358
    newpath
20313 craig 3359
    bars {
3360
        dup -1 ne {
25125 craig 3361
            aload pop  % h x y w
3362
            2 index 1 index 2 div sub 2 index moveto
3363
 
3364
            dup 0 rlineto
3365
 
3366
            closepath
3367
            pop pop pop pop
20313 craig 3368
        } {
3369
            pop
3370
        } ifelse
3371
    } forall
25125 craig 3372
    fill
20313 craig 3373
    grestore
25039 craig 3374
 
20313 craig 3375
    % Display the text for elements in the text array
3376
    textcolor (unset) ne { textcolor setanycolor } if
3377
    includetext {
3378
        textxalign (unset) eq textyalign (unset) eq and alttext () eq and {
3379
            /s 0 def /fn () def
3380
            txt {
3381
                {} forall
3382
                2 copy s ne exch fn ne or {
22439 craig 3383
                    2 copy /s exch def /fn exch def
3384
                    selectfont
20313 craig 3385
                } {
3386
                    pop pop
3387
                } ifelse
3388
                moveto show
3389
            } forall
3390
        } {
22439 craig 3391
            textfont textsize selectfont
20313 craig 3392
            alttext () eq {
3393
                /txt [ txt { 0 get {} forall } forall ] def
3394
                /tstr txt length string def
3395
 
3396
            } {
3397
                /tstr alttext def
3398
            } ifelse
16255 fschmid 3399
 
20313 craig 3400
            % Find true ascent of font
3401
            tstr length 0 eq {
3402
 
3403
            } {
3404
                gsave
3405
                newpath 0 0 moveto (0) false charpath pathbbox
3406
                4 1 roll pop pop pop
3407
                grestore
3408
                currentfont /PaintType known {currentfont /PaintType get 2 eq} {false} ifelse
3409
                currentfont /StrokeWidth known and {
3410
                    currentfont /StrokeWidth get 2 div 0 exch
3411
                    currentfont /FontMatrix get dtransform
3412
                    dup mul exch dup mul add sqrt
3413
                    add
3414
                } if
3415
            } ifelse
3416
            /textascent exch def
3417
            /textwidth tstr stringwidth pop tstr length 1 sub textgaps mul add def
16255 fschmid 3418
 
25125 craig 3419
            /textxpos textxoffset pixx textwidth sub 2 div add def
20313 craig 3420
            textxalign (left) eq { /textxpos textxoffset def } if
25125 craig 3421
            textxalign (right) eq { /textxpos pixx textxoffset sub textwidth sub def } if
20313 craig 3422
            textxalign (offleft) eq { /textxpos textwidth textxoffset add neg def } if
25125 craig 3423
            textxalign (offright) eq { /textxpos pixx textxoffset add def } if
3424
            textxalign (justify) eq textwidth pixx lt and {
20313 craig 3425
                /textxpos 0 def
25125 craig 3426
                /textgaps pixx textwidth sub tstr length 1 sub div def
20313 craig 3427
            } if
3428
            /textypos textyoffset textascent add 1 add neg def
25125 craig 3429
            textyalign (above) eq { /textypos textyoffset pixy add 1 add def } if
3430
            textyalign (center) eq { /textypos textyoffset pixy textascent sub 2 div add def } if
20313 craig 3431
            textxpos textypos moveto textgaps 0 tstr ashow
3432
        } ifelse
25039 craig 3433
    } if
13293 subik 3434
 
20313 craig 3435
    % Display the guard elements
3436
    guardwhitespace {
3437
        0.75 setlinewidth
3438
        guardleftpos 0 ne {
3439
            newpath
3440
            guardleftpos neg guardwidth add guardleftypos guardwidth 2 div add moveto
3441
            guardwidth neg guardheight -2 div rlineto
3442
            guardwidth guardheight -2 div rlineto
25039 craig 3443
            stroke
20313 craig 3444
        } if
3445
        guardrightpos 0 ne {
3446
            newpath
25125 craig 3447
            guardrightpos pixx add guardwidth sub guardrightypos guardheight 2 div add moveto
20313 craig 3448
            guardwidth guardheight -2 div rlineto
3449
            guardwidth neg guardheight -2 div rlineto
25039 craig 3450
            stroke
20313 craig 3451
        } if
3452
    } if
25039 craig 3453
 
20313 craig 3454
    grestore
25039 craig 3455
 
20313 craig 3456
    end
13293 subik 3457
 
25039 craig 3458
}
3459
[/barcode] {null def} forall
3460
bind def
16255 fschmid 3461
/renlinear dup load /uk.co.terryburton.bwipp defineresource pop
3462
end
3463
/setpacking where {pop setpacking} if
18800 fschmid 3464
%%EndData
3465
%%EndResource
13293 subik 3466
% --END RENDERER renlinear--
3467
 
3468
% --BEGIN RENDERER renmatrix--
18800 fschmid 3469
% --REQUIRES preamble raiseerror--
25125 craig 3470
%%BeginResource: uk.co.terryburton.bwipp renmatrix 0.0 2022072900 90555 89769
25039 craig 3471
%%BeginData:        306 ASCII Lines
16255 fschmid 3472
/setpacking where {pop currentpacking true setpacking} if
25125 craig 3473
10 dict
18800 fschmid 3474
dup /raiseerror dup /uk.co.terryburton.bwipp findresource put
16255 fschmid 3475
begin
13293 subik 3476
/renmatrix {
3477
 
20313 craig 3478
    20 dict begin
13293 subik 3479
 
20313 craig 3480
    /args exch def
13293 subik 3481
 
20313 craig 3482
    % Default options
3483
    /width 1 def
3484
    /height 1 def
3485
    /barcolor (unset) def
3486
    /backgroundcolor (unset) def
22439 craig 3487
    /colormap (unset) def
25039 craig 3488
    /dotty false def
21413 craig 3489
    /inkspread 0 def
3490
    /inkspreadh 0 def
3491
    /inkspreadv 0 def
22439 craig 3492
    /includetext false def
3493
    /txt [] def
3494
    /textcolor (unset) def
3495
    /textxalign (unset) def
3496
    /textyalign (unset) def
3497
    /textfont (Courier) def
3498
    /textsize 10 def
3499
    /textxoffset 0 def
3500
    /textyoffset 0 def
3501
    /textgaps 0 def
3502
    /alttext () def
13293 subik 3503
 
20313 craig 3504
    % Apply the renderer options and the user options
3505
    args {def} forall
3506
    opt {def} forall
13293 subik 3507
 
20313 craig 3508
    /width width cvr def
3509
    /height height cvr def
3510
    /barcolor barcolor cvlit def
3511
    /backgroundcolor backgroundcolor cvlit def
21413 craig 3512
    /inkspread inkspread cvr def
3513
    /inkspreadh inkspreadh cvr def
3514
    /inkspreadv inkspreadv cvr def
22439 craig 3515
    /textcolor textcolor cvlit def
3516
    /textxalign textxalign cvlit def
3517
    /textyalign textyalign cvlit def
3518
    /textfont textfont cvlit def
3519
    /textsize textsize cvr def
3520
    /textxoffset textxoffset cvr def
3521
    /textyoffset textyoffset cvr def
3522
    /textgaps textgaps cvr def
3523
    /alttext alttext cvlit def
13293 subik 3524
 
21413 craig 3525
    inkspread 0 ne {/inkspreadh inkspread def} if
3526
    inkspread 0 ne {/inkspreadv inkspread def} if
3527
 
25039 craig 3528
    /xyget { pixx mul add pixs exch get} bind def
3529
    /cget { pixx mul add cache exch get and} bind def
3530
    /cput {  % Optimise by only storing "stem" corners
3531
        dup 4 mod 0 eq { % dir is up or left
3532
            3 1 roll pixx mul add cache exch 2 copy get 4 -1 roll or put
3533
        } {
3534
            pop pop pop
3535
        } ifelse
21413 craig 3536
    } bind def
3537
 
25039 craig 3538
    /abcd {
3539
        4 string 0 [
3540
            5 -2 roll
3541
            pixx mul add dup
3542
            pixs exch 2 getinterval aload pop 3 -1 roll  % A B
3543
            pixs exch pixx add 2 getinterval aload pop   % C D
3544
        ] {3 copy 48 add put pop 1 add} forall pop
3545
    } bind def
3546
 
3547
    /right {dir 1 ne {x y dir cput [x y]} if  /x x 1 add def  /dir 1 def} bind def
3548
    /down  {dir 2 ne {x y dir cput [x y]} if  /y y 1 add def  /dir 2 def} bind def
3549
    /left  {dir 4 ne {x y dir cput [x y]} if  /x x 1 sub def  /dir 4 def} bind def
3550
    /up    {dir 8 ne {x y dir cput [x y]} if  /y y 1 sub def  /dir 8 def} bind def
3551
 
21413 craig 3552
    /trace {
3553
        % Walk the outline of a region emitting edge coordinates of the path
3554
        /y exch def  /x exch def
25039 craig 3555
        % dir 1:right 2:down 4:left 8:up
3556
        /dir x 1 add y 1 add xyget 1 eq {8} {4} ifelse def
21413 craig 3557
        /sx x def  /sy y def  /sdir dir def
25039 craig 3558
 
3559
        % A B
3560
        % C D
3561
        mark {
3562
            x y abcd
3563
            1 {  % Common exit
3564
                dup dup (0001) eq exch dup (0011) eq exch (1011) eq or or {pop right exit} if
3565
                dup dup (0010) eq exch dup (1010) eq exch (1110) eq or or {pop down  exit} if
3566
                dup dup (1000) eq exch dup (1100) eq exch (1101) eq or or {pop left  exit} if
3567
                dup dup (0100) eq exch dup (0101) eq exch (0111) eq or or {pop up    exit} if
3568
                dup (1001) eq {
3569
                    dir 2 eq {pop left exit} {pop right exit} ifelse
3570
                } {  % 0110
3571
                    dir 1 eq {pop down exit} {pop up exit} ifelse
21413 craig 3572
                } ifelse
25039 craig 3573
            } repeat
21413 craig 3574
            x sx eq y sy eq and dir sdir eq and {exit} if
3575
        } loop
3576
        counttomark array astore exch pop
3577
 
3578
    } bind def
3579
 
20313 craig 3580
    % Set RGB or CMYK color depending on length of given hex string
3581
    /setanycolor {
3582
        /anycolor exch def
3583
        anycolor length 6 eq {
3584
            (<      >) 8 string copy dup 1 anycolor putinterval cvx exec {255 div} forall setrgbcolor
3585
        } if
3586
        anycolor length 8 eq {
3587
            (<        >) 10 string copy dup 1 anycolor putinterval cvx exec {255 div} forall setcmykcolor
3588
        } if
3589
    } bind def
13293 subik 3590
 
22439 craig 3591
    % Plot a layer of single colour
3592
    /drawlayer {
3593
 
3594
        /pixsorig pixs def
3595
        /pixs exch def
3596
 
3597
        % Pad the bitmap on all sides
3598
        /pixs [
3599
            pixx 2 add {0} repeat
3600
 
3601
 
3602
                pixs exch pixx getinterval aload pop
3603
 
3604
            } for
3605
            pixx 2 add {0} repeat
3606
        ] def
3607
        /pixx pixx 2 add def
3608
        /pixy pixy 2 add def
3609
 
25039 craig 3610
        % Cache of visited corners for each direction
3611
        /cache [ pixs length {0} repeat ] def
22439 craig 3612
 
25039 craig 3613
        % Construct paths by tracing regions avoiding duplication by using the cache
22439 craig 3614
        /paths [
25039 craig 3615
 
22439 craig 3616
                /j exch def
25039 craig 3617
 
22439 craig 3618
                    /i exch def
25039 craig 3619
                    /k i j abcd def
3620
                    k (0001) eq k (1001) eq or {  % Black region stem corners
3621
                        8 i j cget 0 eq {
3622
                            i j trace
3623
                        } if
22439 craig 3624
                    } if
25039 craig 3625
                    k (1110) eq {  % White region stem corner
3626
                        4 i j cget 0 eq {
3627
                            i j trace
3628
                        } if
3629
                    } if
22439 craig 3630
                } for
3631
            } for
3632
        ] def
3633
 
3634
        % Revert the bitmap size
3635
        /pixx pixx 2 sub def
3636
        /pixy pixy 2 sub def
3637
 
3638
        % Draw the image
3639
        newpath
3640
        paths {
3641
            /p exch def
3642
            /len p length def
3643
            p len 1 sub get aload pop
3644
            p 0 get aload pop
3645
 
3646
                /i exch def
3647
                p i 1 add len mod get aload pop 6 -2 roll  % x3 y3 x1 y1 x2 y2
3648
                5 index inkspreadh
3649
                4 index 4 -1 roll lt {add} {sub} ifelse    % y3<y1 ? x2+i : x2-i
3650
                4 1 roll
3651
                4 index inkspreadv
3652
                4 index 4 -1 roll gt {add} {sub} ifelse    % x3>x1 ? y2+i : y2-i
3653
                4 -1 roll exch pixy exch sub
3654
                i 0 eq {moveto} {lineto} ifelse
3655
            } for                                          % x2 y2 x3 y3
3656
            closepath
3657
            pop pop pop pop
3658
        } forall
3659
        fill
3660
 
3661
        /pixs pixsorig def
3662
 
3663
    } bind def
3664
 
25039 craig 3665
    /drawlayerdots {
3666
 
3667
        /pixsorig pixs def
3668
        /pixs exch def
3669
 
3670
        newpath
3671
 
3672
            dup pixx mod /x exch def
3673
            pixx idiv /y exch def
3674
            x y xyget 1 eq {
3675
               x 0.5 add pixy y sub 0.5 sub moveto
3676
               x 0.5 add pixy y sub 0.5 sub 0.5 inkspread sub 0 360 arc
3677
            } if
3678
        } for
3679
        fill
3680
 
3681
        /pixs pixsorig def
3682
 
3683
    } bind def
3684
 
22439 craig 3685
    gsave
3686
 
20313 craig 3687
    % Draw the image
25039 craig 3688
    /inkspread  inkspread  2 div def
21413 craig 3689
    /inkspreadh inkspreadh 2 div def
3690
    /inkspreadv inkspreadv 2 div def
20313 craig 3691
    currentpoint translate
3692
    width pixx div 72 mul height pixy div 72 mul scale
3693
 
21413 craig 3694
    backgroundcolor (unset) ne { gsave backgroundcolor setanycolor fill grestore } if
22439 craig 3695
 
3696
    colormap (unset) eq {
3697
        /colormap << 1 barcolor >> def
3698
    } if
3699
 
3700
    colormap {
3701
        setanycolor
3702
        /key exch def
3703
        [
3704
            pixs { key eq {1} {0} ifelse } forall
25039 craig 3705
        ] dotty {drawlayerdots} {drawlayer} ifelse
21413 craig 3706
    } forall
22439 craig 3707
 
3708
    % Display the text for elements in the text array
3709
    textcolor (unset) ne { textcolor setanycolor } if
3710
    includetext {
3711
        textxalign (unset) eq textyalign (unset) eq and alttext () eq and {
3712
            /s 0 def /fn () def
3713
            txt {
3714
                {} forall
3715
                2 copy s ne exch fn ne or {
3716
                    2 copy /s exch def /fn exch def
3717
                    selectfont
3718
                } {
3719
                    pop pop
3720
                } ifelse
3721
                moveto show
3722
            } forall
3723
        } {
3724
            textfont textsize selectfont
3725
            alttext () eq {
3726
                /txt [ txt { 0 get {} forall } forall ] def
3727
                /tstr txt length string def
3728
 
3729
            } {
3730
                /tstr alttext def
3731
            } ifelse
3732
 
3733
            % Find true ascent of font
3734
            tstr length 0 eq {
3735
 
3736
            } {
3737
                gsave
3738
                newpath 0 0 moveto (0) false charpath pathbbox
3739
                4 1 roll pop pop pop
3740
                grestore
3741
                currentfont /PaintType known {currentfont /PaintType get 2 eq} {false} ifelse
3742
                currentfont /StrokeWidth known and {
3743
                    currentfont /StrokeWidth get 2 div 0 exch
3744
                    currentfont /FontMatrix get dtransform
3745
                    dup mul exch dup mul add sqrt
3746
                    add
3747
                } if
3748
            } ifelse
3749
            /textascent exch def
3750
            /textwidth tstr stringwidth pop tstr length 1 sub textgaps mul add def
3751
 
25125 craig 3752
            /textxpos textxoffset pixx textwidth sub 2 div add def
22439 craig 3753
            textxalign (left) eq { /textxpos textxoffset def } if
25125 craig 3754
            textxalign (right) eq { /textxpos pixx textxoffset sub textwidth sub def } if
22439 craig 3755
            textxalign (offleft) eq { /textxpos textwidth textxoffset add neg def } if
25125 craig 3756
            textxalign (offright) eq { /textxpos pixx textxoffset add def } if
3757
            textxalign (justify) eq textwidth pixx lt and {
22439 craig 3758
                /textxpos 0 def
25125 craig 3759
                /textgaps pixx textwidth sub tstr length 1 sub div def
22439 craig 3760
            } if
3761
            /textypos textyoffset textascent add 1 add neg def
3762
            textyalign (above) eq { /textypos textyoffset pixy add 1 add def } if
3763
            textyalign (center) eq { /textypos textyoffset pixy textascent sub 2 div add def } if
3764
            textxpos textypos moveto textgaps 0 tstr ashow
3765
        } ifelse
3766
    } if
3767
 
20313 craig 3768
    grestore
13293 subik 3769
 
20313 craig 3770
    end
13293 subik 3771
 
25039 craig 3772
}
3773
[/barcode] {null def} forall
3774
bind def
16255 fschmid 3775
/renmatrix dup load /uk.co.terryburton.bwipp defineresource pop
3776
end
3777
/setpacking where {pop setpacking} if
18800 fschmid 3778
%%EndData
3779
%%EndResource
13293 subik 3780
% --END RENDERER renmatrix--
3781
 
3782
% --BEGIN RENDERER renmaximatrix--
18800 fschmid 3783
% --REQUIRES preamble raiseerror--
25125 craig 3784
%%BeginResource: uk.co.terryburton.bwipp renmaximatrix 0.0 2022072900 50138 49904
25039 craig 3785
%%BeginData:         81 ASCII Lines
16255 fschmid 3786
/setpacking where {pop currentpacking true setpacking} if
25125 craig 3787
10 dict
18800 fschmid 3788
dup /raiseerror dup /uk.co.terryburton.bwipp findresource put
16255 fschmid 3789
begin
13293 subik 3790
/renmaximatrix {
3791
 
20313 craig 3792
    20 dict begin
13293 subik 3793
 
20313 craig 3794
    /args exch def   % We are given some arguments
13293 subik 3795
 
20313 craig 3796
    % Default options
3797
    /barcolor (unset) def
3798
    /backgroundcolor (unset) def
18800 fschmid 3799
 
20313 craig 3800
    % Apply the renderer options and the user options
3801
    args {def} forall
3802
    opt {def} forall
18800 fschmid 3803
 
20313 craig 3804
    /barcolor barcolor cvlit def
3805
    /backgroundcolor backgroundcolor cvlit def
18800 fschmid 3806
 
20313 craig 3807
    % Set RGB or CMYK color depending on length of given hex string
3808
    /setanycolor {
3809
        /anycolor exch def
3810
        anycolor length 6 eq {
3811
            (<      >) 8 string copy dup 1 anycolor putinterval cvx exec {255 div} forall setrgbcolor
3812
        } if
3813
        anycolor length 8 eq {
3814
            (<        >) 10 string copy dup 1 anycolor putinterval cvx exec {255 div} forall setcmykcolor
3815
        } if
3816
    } bind def
18800 fschmid 3817
 
20313 craig 3818
    gsave
13293 subik 3819
 
20313 craig 3820
    currentpoint translate
13293 subik 3821
 
22439 craig 3822
    2.4945 dup scale  % from 1pt to 0.88mm
18800 fschmid 3823
 
20313 craig 3824
 
22439 craig 3825
    backgroundcolor (unset) ne { gsave backgroundcolor setanycolor fill grestore } if
20313 craig 3826
    barcolor (unset) ne { barcolor setanycolor } if
18800 fschmid 3827
 
20313 craig 3828
    0.5 0.5774 translate
13293 subik 3829
 
20313 craig 3830
    newpath
3831
    pixs {
22439 craig 3832
        dup
3833
        /x exch 30 mod def
20313 craig 3834
        /y exch 30 idiv def
3835
        y 2 mod 0 eq {x} {x 0.5 add} ifelse
3836
        32 y sub 0.8661 mul
3837
        moveto
3838
 
3839
        -0.5 -0.2887 rlineto
3840
 
3841
        0.5  -0.2887 rlineto
3842
        0.5   0.2887 rlineto
3843
 
3844
        -0.5  0.2887 rlineto
3845
        closepath
3846
    } forall
3847
    fill
13293 subik 3848
 
20313 craig 3849
    % Plot the locator symbol
3850
    newpath 14 13.8576 0.5774 0 360 arc closepath
3851
    14 13.8576 1.3359 360 0 arcn closepath fill
3852
    newpath 14 13.8576 2.1058 0 360 arc closepath
3853
    14 13.8576 2.8644 360 0 arcn closepath fill
3854
    newpath 14 13.8576 3.6229 0 360 arc closepath
3855
    14 13.8576 4.3814 360 0 arcn closepath fill
13293 subik 3856
 
20313 craig 3857
    grestore
13293 subik 3858
 
20313 craig 3859
    end
13293 subik 3860
 
25039 craig 3861
}
3862
[/barcode] {null def} forall
3863
bind def
16255 fschmid 3864
/renmaximatrix dup load /uk.co.terryburton.bwipp defineresource pop
3865
end
3866
/setpacking where {pop setpacking} if
18800 fschmid 3867
%%EndData
3868
%%EndResource
13293 subik 3869
% --END RENDERER renmaximatrix--
3870
 
3871
% --BEGIN ENCODER ean5--
25125 craig 3872
% --REQUIRES preamble loadctx unloadctx raiseerror renlinear--
13293 subik 3873
% --DESC: EAN-5 (5 digit addon)
3874
% --EXAM: 90200
3875
% --EXOP: includetext guardwhitespace
3876
% --RNDR: renlinear
25125 craig 3877
%%BeginResource: uk.co.terryburton.bwipp ean5 0.0 2022072900 67684 63946
3878
%%BeginData:        147 ASCII Lines
16255 fschmid 3879
/setpacking where {pop currentpacking true setpacking} if
25125 craig 3880
10 dict
3881
dup /loadctx dup /uk.co.terryburton.bwipp findresource put
3882
dup /unloadctx dup /uk.co.terryburton.bwipp findresource put
18800 fschmid 3883
dup /raiseerror dup /uk.co.terryburton.bwipp findresource put
16255 fschmid 3884
dup /renlinear dup /uk.co.terryburton.bwipp findresource put
3885
begin
13293 subik 3886
/ean5 {
3887
 
20313 craig 3888
    20 dict begin
13293 subik 3889
 
20313 craig 3890
    /options exch def                   % We are given an option string
3891
    /barcode exch def                   % We are given a barcode string
13293 subik 3892
 
25125 craig 3893
    /ctx null def
20313 craig 3894
    /dontdraw false def
3895
    /includetext false def              % Enable/disable text
3896
    /textfont /Helvetica def
3897
    /textsize 12 def
3898
    /textxoffset 0 def
3899
    /textyoffset (unset) def
25039 craig 3900
    /height 0.7 def
3901
 
20313 craig 3902
    % Parse the input options
3903
    options type /stringtype eq {
3904
        1 dict begin
3905
        options {
3906
            token false eq {exit} if dup length string cvs (=) search
3907
            true eq {cvlit exch pop exch def} {cvlit true def} ifelse
3908
        } loop
3909
        currentdict end /options exch def
3910
    } if
25039 craig 3911
    options {def} forall
3912
 
20313 craig 3913
    /textfont textfont cvlit def
3914
    /textsize textsize cvr def
3915
    /height height cvr def
3916
    /textxoffset textxoffset cvr def
3917
    textyoffset (unset) eq {
3918
        /textyoffset height 72 mul 1 add def
3919
    } {
3920
        /textyoffset textyoffset cvr def
3921
    } ifelse
18800 fschmid 3922
 
25125 craig 3923
    /ean5 //loadctx exec
3924
 
20313 craig 3925
    % Validate input
3926
    barcode length 5 ne {
3927
        /bwipp.ean5badLength (EAN-5 add-on must be 5 digits) //raiseerror exec
3928
    } if
3929
    barcode {
3930
        dup 48 lt exch 57 gt or {
3931
            /bwipp.ean5badCharacter (EAN-5 add-on must contain only digits) //raiseerror exec
3932
        } if
3933
    } forall
25039 craig 3934
 
25125 craig 3935
{
20313 craig 3936
    % Create an array containing the character mappings
3937
    /encs
3938
    [ (3211) (2221) (2122) (1411) (1132)
3939
      (1231) (1114) (1312) (1213) (3112)
3940
      (112) (11)
3941
    ] def
13293 subik 3942
 
20313 craig 3943
    % Create a string of the available characters
3944
    /barchars (0123456789) def
13293 subik 3945
 
20313 craig 3946
    % Determine the mirror map based on mod 10 checksum
3947
    /mirrormaps
3948
    [ (11000) (10100) (10010) (10001) (01100)
3949
      (00110) (00011) (01010) (01001) (00101)
3950
    ] def
25125 craig 3951
} ctxdef
3952
 
20313 craig 3953
    /checksum 0 def
3954
 
3955
        /i exch def
3956
        /barchar barcode i get 48 sub def
3957
        i 2 mod 0 eq {
3958
            /checksum barchar 3 mul checksum add def
3959
        } {
3960
            /checksum barchar 9 mul checksum add def
3961
        } ifelse
3962
    } for
3963
    /checksum checksum 10 mod def
3964
    /mirrormap mirrormaps checksum get def
13293 subik 3965
 
20313 craig 3966
    /sbs 31 string def
3967
    /txt 5 array def
25039 craig 3968
 
20313 craig 3969
 
3970
        /i exch def
13293 subik 3971
 
20313 craig 3972
        % Prefix with either a start character or separator character
3973
        i 0 eq {
3974
            sbs 0 encs 10 get putinterval
3975
        } {
3976
            sbs i 1 sub 6 mul 7 add encs 11 get putinterval
3977
        } ifelse
13293 subik 3978
 
20313 craig 3979
        % Lookup the encoding for the barcode character
3980
        barcode i 1 getinterval barchars exch search
3981
        pop                     % Discard true leaving pre
3982
        length /indx exch def   % indx is the length of pre
3983
        pop pop                 % Discard seek and post
3984
        /enc encs indx get def  % Get the indxth encoding
3985
        mirrormap i get 49 eq { % Reverse enc if 1 in this position in mirrormap
3986
            /enclen enc length def
3987
            /revenc enclen string def
3988
 
3989
                /j exch def
3990
                /char enc j get def
3991
                revenc enclen j sub 1 sub char put
3992
            } for
3993
            /enc revenc def
3994
        } if
3995
        sbs i 6 mul 3 add enc putinterval   % Put encoded digit into sbs
3996
        txt i [barcode i 1 getinterval i 1 sub 9 mul 13 add textxoffset add textyoffset textfont textsize] put
3997
    } for
13293 subik 3998
 
20313 craig 3999
    % Return the arguments
4000
    <<
4001
    /ren //renlinear
4002
    /sbs [sbs {48 sub} forall]
4003
    /bhs [16{height}repeat]
4004
    /bbs [16{0}repeat]
4005
    includetext {
4006
        /txt txt
4007
    } if
4008
    /opt options
4009
    /guardrightpos 10
4010
    /guardrightypos textyoffset 4 add
4011
    /bordertop 10
4012
    >>
13293 subik 4013
 
20313 craig 4014
    dontdraw not //renlinear if
13293 subik 4015
 
25125 craig 4016
    //unloadctx exec
4017
 
20313 craig 4018
    end
13293 subik 4019
 
25039 craig 4020
}
4021
[/barcode] {null def} forall
4022
bind def
16255 fschmid 4023
/ean5 dup load /uk.co.terryburton.bwipp defineresource pop
4024
end
4025
/setpacking where {pop setpacking} if
18800 fschmid 4026
%%EndData
4027
%%EndResource
13293 subik 4028
% --END ENCODER ean5--
4029
 
4030
% --BEGIN ENCODER ean2--
25125 craig 4031
% --REQUIRES preamble loadctx unloadctx raiseerror renlinear--
13293 subik 4032
% --DESC: EAN-2 (2 digit addon)
4033
% --EXAM: 05
4034
% --EXOP: includetext guardwhitespace
4035
% --RNDR: renlinear
25125 craig 4036
%%BeginResource: uk.co.terryburton.bwipp ean2 0.0 2022072900 66331 62624
4037
%%BeginData:        133 ASCII Lines
16255 fschmid 4038
/setpacking where {pop currentpacking true setpacking} if
25125 craig 4039
10 dict
4040
dup /loadctx dup /uk.co.terryburton.bwipp findresource put
4041
dup /unloadctx dup /uk.co.terryburton.bwipp findresource put
18800 fschmid 4042
dup /raiseerror dup /uk.co.terryburton.bwipp findresource put
16255 fschmid 4043
dup /renlinear dup /uk.co.terryburton.bwipp findresource put
4044
begin
13293 subik 4045
/ean2 {
4046
 
20313 craig 4047
    20 dict begin
13293 subik 4048
 
20313 craig 4049
    /options exch def                   % We are given an options string
4050
    /barcode exch def                   % We are given a barcode string
13293 subik 4051
 
25125 craig 4052
    /ctx null def
20313 craig 4053
    /dontdraw false def
4054
    /includetext false def               % Enable/disable text
4055
    /textfont /Helvetica def
4056
    /textsize 12 def
4057
    /textxoffset 0 def
4058
    /textyoffset (unset) def
4059
    /height 0.7 def
25039 craig 4060
 
20313 craig 4061
    % Parse the input options
4062
    options type /stringtype eq {
4063
        1 dict begin
4064
        options {
4065
            token false eq {exit} if dup length string cvs (=) search
4066
            true eq {cvlit exch pop exch def} {cvlit true def} ifelse
4067
        } loop
4068
        currentdict end /options exch def
4069
    } if
4070
    options {def} forall
25039 craig 4071
 
20313 craig 4072
    /textfont textfont cvlit def
4073
    /textsize textsize cvr def
4074
    /height height cvr def
4075
    /textxoffset textxoffset cvr def
4076
    textyoffset (unset) eq {
4077
        /textyoffset height 72 mul 1 add def
4078
    } {
4079
        /textyoffset textyoffset cvr def
4080
    } ifelse
18800 fschmid 4081
 
25125 craig 4082
    /ean2 //loadctx exec
4083
 
20313 craig 4084
    % Validate input
4085
    barcode length 2 ne {
4086
      /bwipp.ean2badLength (EAN-2 add-on must be 2 digits) //raiseerror exec
4087
    } if
4088
    barcode {
4089
        dup 48 lt exch 57 gt or {
4090
            /bwipp.ean2badCharacter (EAN-2 add-on must contain only digits) //raiseerror exec
4091
        } if
4092
    } forall
25039 craig 4093
 
25125 craig 4094
{
20313 craig 4095
    % Create an array containing the character mappings
4096
    /encs
4097
    [ (3211) (2221) (2122) (1411) (1132)
4098
      (1231) (1114) (1312) (1213) (3112)
4099
      (112) (11)
4100
    ] def
13293 subik 4101
 
20313 craig 4102
    % Create a string of the available characters
4103
    /barchars (0123456789) def
13293 subik 4104
 
20313 craig 4105
    % Determine the mirror map based on mod 4 checksum
25125 craig 4106
    /mirrormaps [(00) (01) (10) (11)] def
4107
} ctxdef
13293 subik 4108
 
25125 craig 4109
    /mirrormap mirrormaps barcode 0 2 getinterval cvi 4 mod get def
4110
 
20313 craig 4111
    /sbs 13 string def
4112
    /txt 2 array def
25039 craig 4113
 
20313 craig 4114
 
4115
        /i exch def
13293 subik 4116
 
20313 craig 4117
        % Prefix with either a start character or separator character
4118
        i 0 eq {
4119
            sbs 0 encs 10 get putinterval
4120
        } {
4121
            sbs i 1 sub 6 mul 7 add encs 11 get putinterval
4122
        } ifelse
13293 subik 4123
 
20313 craig 4124
        % Lookup the encoding for the barcode character
4125
        barcode i 1 getinterval barchars exch search
4126
        pop                     % Discard true leaving pre
4127
        length /indx exch def   % indx is the length of pre
4128
        pop pop                 % Discard seek and post
4129
        /enc encs indx get def  % Get the indxth encoding
25039 craig 4130
        mirrormap i get 49 eq { % Reverse enc if 1 in this position in mirrormap
20313 craig 4131
            /enclen enc length def
4132
            /revenc enclen string def
4133
 
4134
                /j exch def
4135
                /char enc j get def
4136
                revenc enclen j sub 1 sub char put
4137
            } for
4138
            /enc revenc def
4139
        } if
4140
        sbs i 6 mul 3 add enc putinterval   % Put encoded digit into sbs
4141
        txt i [barcode i 1 getinterval i 1 sub 9 mul 13 add textxoffset add textyoffset textfont textsize] put
4142
    } for
13293 subik 4143
 
20313 craig 4144
    % Return the arguments
4145
    <<
4146
    /ren //renlinear
4147
    /sbs [sbs {48 sub} forall]
4148
    /bhs [12{height}repeat]
4149
    /bbs [12{0}repeat]
4150
    includetext {
4151
        /txt txt
4152
    } if
4153
    /opt options
4154
    /guardrightpos 10
4155
    /guardrightypos textyoffset 4 add
4156
    /bordertop 10
4157
    >>
13293 subik 4158
 
20313 craig 4159
    dontdraw not //renlinear if
13293 subik 4160
 
25125 craig 4161
    //unloadctx exec
4162
 
20313 craig 4163
    end
13293 subik 4164
 
25039 craig 4165
}
4166
[/barcode] {null def} forall
4167
bind def
16255 fschmid 4168
/ean2 dup load /uk.co.terryburton.bwipp defineresource pop
4169
end
4170
/setpacking where {pop setpacking} if
18800 fschmid 4171
%%EndData
4172
%%EndResource
13293 subik 4173
% --END ENCODER ean2--
4174
 
4460 subik 4175
% --BEGIN ENCODER ean13--
25125 craig 4176
% --REQUIRES preamble loadctx unloadctx raiseerror renlinear ean5 ean2--
7162 subik 4177
% --DESC: EAN-13
18800 fschmid 4178
% --EXAM: 2112345678900
11277 subik 4179
% --EXOP: includetext guardwhitespace
4180
% --RNDR: renlinear
25125 craig 4181
%%BeginResource: uk.co.terryburton.bwipp ean13 0.0 2022072900 87046 86773
4182
%%BeginData:        226 ASCII Lines
16255 fschmid 4183
/setpacking where {pop currentpacking true setpacking} if
25125 craig 4184
10 dict
4185
dup /loadctx dup /uk.co.terryburton.bwipp findresource put
4186
dup /unloadctx dup /uk.co.terryburton.bwipp findresource put
18800 fschmid 4187
dup /raiseerror dup /uk.co.terryburton.bwipp findresource put
16255 fschmid 4188
dup /renlinear dup /uk.co.terryburton.bwipp findresource put
4189
dup /ean2 dup /uk.co.terryburton.bwipp findresource put
4190
dup /ean5 dup /uk.co.terryburton.bwipp findresource put
4191
begin
4460 subik 4192
/ean13 {
4193
 
20313 craig 4194
    20 dict begin
4460 subik 4195
 
20313 craig 4196
    /options exch def                  % We are given an option string
4197
    /barcode exch def                  % We are given a barcode string
4460 subik 4198
 
25125 craig 4199
    /ctx null def
20313 craig 4200
    /dontdraw false def
4201
    /includetext false def             % Enable/disable text
4202
    /textfont /Helvetica def
4203
    /textsize 12 def
4204
    /textxoffset -10 def
4205
    /textyoffset -4 def
4206
    /height 1 def
4207
    /addongap 12 def
4208
    /addontextfont (unset) def
4209
    /addontextsize (unset) def
4210
    /addontextxoffset (unset) def
4211
    /addontextyoffset (unset) def
13293 subik 4212
 
20313 craig 4213
    % Parse the input options, either a string or a dict
4214
    options type /stringtype eq {
4215
        1 dict begin
4216
        options {
4217
            token false eq {exit} if dup length string cvs (=) search
4218
            true eq {cvlit exch pop exch def} {cvlit true def} ifelse
4219
        } loop
4220
        currentdict end /options exch def
4221
    } if
4222
    options {def} forall
13293 subik 4223
 
20313 craig 4224
    /textfont textfont cvlit def
4225
    /textsize textsize cvr def
4226
    /textxoffset textxoffset cvr def
4227
    /textyoffset textyoffset cvr def
4228
    /height height cvr def
25039 craig 4229
    /addongap addongap cvr def
20313 craig 4230
    addontextfont (unset) ne {/addontextfont addontextfont cvlit def} if
4231
    addontextsize (unset) ne {/addontextsize addontextsize cvr def} if
4232
    addontextxoffset (unset) ne {/addontextxoffset addontextxoffset cvr def} if
4233
    addontextyoffset (unset) ne {/addontextyoffset addontextyoffset cvr def} if
4460 subik 4234
 
25125 craig 4235
    /ean13 //loadctx exec
4236
 
20313 craig 4237
    % Split off the addon
4238
    barcode ( ) search {
4239
        /barcode exch def
4240
        pop
4241
        /addon exch def
4242
    } {
4243
        pop
4244
        /addon () def
4245
    } ifelse
18800 fschmid 4246
 
20313 craig 4247
    % Validate the input
4248
    barcode length 12 ne barcode length 13 ne and {
4249
        /bwipp.ean13badLength (EAN-13 must be 12 or 13 digits) //raiseerror exec
4250
    } if
4251
    barcode {
4252
        dup 48 lt exch 57 gt or {
4253
            /bwipp.ean13badCharacter (EAN-13 must contain only digits) //raiseerror exec
4254
        } if
4255
    } forall
4256
    addon length 0 ne addon length 2 ne and addon length 5 ne and {
4257
        /bwipp.ean13badAddOnLength (Add-on for EAN-13 must be 2 or 5 digits) //raiseerror exec
4258
    } if
18800 fschmid 4259
 
20313 craig 4260
    % Add checksum digit
4261
    /pad 13 string def
4262
    /checksum 0 def
4263
 
4264
        /i exch def
4265
        /barchar barcode i get 48 sub def
4266
        i 2 mod 0 eq {
4267
            /checksum barchar checksum add def
4268
        } {
4269
            /checksum barchar 3 mul checksum add def
4270
        } ifelse
4271
    } for
4272
    /checksum 10 checksum 10 mod sub 10 mod def
4273
    barcode length 13 eq {
4274
        barcode 12 get checksum 48 add ne {
4275
            /bwipp.ean13badCheckDigit (Incorrect EAN-13 check digit provided) //raiseerror exec
4276
        } if
4277
    } if
4278
    pad 0 barcode putinterval       % Add barcode to the start of the pad
4279
    pad 12 checksum 48 add put      % Put ascii for checksum at end of pad
4280
    /barcode pad def
4460 subik 4281
 
25125 craig 4282
{
20313 craig 4283
    % Create an array containing the character mappings
4284
    /encs
4285
    [ (3211) (2221) (2122) (1411) (1132)
4286
      (1231) (1114) (1312) (1213) (3112)
4287
      (111) (11111) (111)
4288
    ] def
4460 subik 4289
 
20313 craig 4290
    % Create a string of the available characters
4291
    /barchars (0123456789) def
4460 subik 4292
 
20313 craig 4293
    % Digits to mirror on left side
4294
    /mirrormaps
4295
    [ (000000) (001011) (001101) (001110) (010011)
4296
      (011001) (011100) (010101) (010110) (011010)
4297
    ] def