3
% Barcode Writer in Pure PostScript
4
% http://www.terryburton.co.uk/barcodewriter/
6
% Copyright (c) 2004-2014 Terry Burton
10
% Permission is hereby granted, free of charge, to any
11
% person obtaining a copy of this software and associated
12
% documentation files (the "Software"), to deal in the
13
% Software without restriction, including without
14
% limitation the rights to use, copy, modify, merge,
15
% publish, distribute, sublicense, and/or sell copies of
16
% the Software, and to permit persons to whom the Software
17
% is furnished to do so, subject to the following
20
% The above copyright notice and this permission notice
21
% shall be included in all copies or substantial portions
24
% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
25
% KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
26
% THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
27
% PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
28
% THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
29
% DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
30
% CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31
% CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
34
% --BEGIN RENDERER renmaximatrix--
35
% --REQUIRES preamble raiseerror--
36
/setpacking where {pop currentpacking true setpacking} if
38
dup /raiseerror dup /uk.co.terryburton.bwipp findresource put
44
/args exch def % We are given some arguments
48
/backgroundcolor (unset) def
50
% Apply the renderer options and the user options
54
/barcolor barcolor cvlit def
55
/backgroundcolor backgroundcolor cvlit def
57
% Set RGB or CMYK color depending on length of given hex string
60
anycolor length 6 eq {
61
(< >) 8 string copy dup 1 anycolor putinterval cvx exec {255 div} forall setrgbcolor
63
anycolor length 8 eq {
64
(< >) 10 string copy dup 1 anycolor putinterval cvx exec {255 div} forall setcmykcolor
70
currentpoint translate
72
2.4945 dup scale % from 1pt to 1.88mm
74
0 0 moveto 30 0 lineto 30 29 lineto 0 29 lineto closepath
75
backgroundcolor (unset) ne { gsave backgroundcolor setanycolor fill grestore } if
76
barcolor (unset) ne { barcolor setanycolor } if
85
y 2 mod 0 eq {x} {x 0.5 add} ifelse
99
% Plot the locator symbol
100
newpath 14 13.8576 0.5774 0 360 arc closepath
101
14 13.8576 1.3359 360 0 arcn closepath fill
102
newpath 14 13.8576 2.1058 0 360 arc closepath
103
14 13.8576 2.8644 360 0 arcn closepath fill
104
newpath 14 13.8576 3.6229 0 360 arc closepath
105
14 13.8576 4.3814 360 0 arcn closepath fill
112
/renmaximatrix dup load /uk.co.terryburton.bwipp defineresource pop
114
/setpacking where {pop setpacking} if
115
% --END RENDERER renmaximatrix--