diff options
author | Karl Berry <karl@freefriends.org> | 2017-04-16 22:17:59 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-04-16 22:17:59 +0000 |
commit | 1b09f4bdca618bcbfca16d25489b96ab22875230 (patch) | |
tree | 2aeb2a57631dfc263677c46ccf370a286a8b5771 /Master/texmf-dist/dvips | |
parent | e2f647f28d1d99392613d28f7b1a751a57f7bbd1 (diff) |
pst-barcode (14apr17)
git-svn-id: svn://tug.org/texlive/trunk@43856 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/dvips')
-rw-r--r-- | Master/texmf-dist/dvips/pst-barcode/pst-barcode.pro | 996 |
1 files changed, 717 insertions, 279 deletions
diff --git a/Master/texmf-dist/dvips/pst-barcode/pst-barcode.pro b/Master/texmf-dist/dvips/pst-barcode/pst-barcode.pro index b61c30e5e5c..09e2e4cb65d 100644 --- a/Master/texmf-dist/dvips/pst-barcode/pst-barcode.pro +++ b/Master/texmf-dist/dvips/pst-barcode/pst-barcode.pro @@ -1,8 +1,8 @@ %!PS -% Barcode Writer in Pure PostScript - Version 2016-04-21 +% Barcode Writer in Pure PostScript - Version 2017-04-04 % http://bwipp.terryburton.co.uk % -% Copyright (c) 2004-2016 Terry Burton +% Copyright (c) 2004-2017 Terry Burton % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated @@ -27,14 +27,13 @@ % CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN % CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS % IN THE SOFTWARE. - % --BEGIN TEMPLATE-- - % --BEGIN RESOURCE preamble-- -%%BeginResource: Category uk.co.terryburton.bwipp 0.0 2016042100 31191 34576 +%%BeginResource: Category uk.co.terryburton.bwipp 0.0 2017040400 29725 32822 %%BeginData: 6 ASCII Lines currentglobal true setglobal +/Times (Times-Roman) def /Generic /Category findresource dup length 1 add dict copy dup /InstanceType /setpacking where {pop /packedarraytype} {/arraytype} ifelse put /uk.co.terryburton.bwipp exch /Category defineresource pop @@ -45,7 +44,7 @@ setglobal % --BEGIN RESOURCE raiseerror-- % --REQUIRES preamble-- -%%BeginResource: uk.co.terryburton.bwipp raiseerror 0.0 2016042100 44890 44440 +%%BeginResource: uk.co.terryburton.bwipp raiseerror 0.0 2017040400 153316 39839 %%BeginData: 13 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -54,8 +53,8 @@ begin $error exch /errorinfo exch put $error exch /errorname exch put $error /command null put - $error /newerror true put - handleerror quit + $error /newerror true put + stop } bind def /raiseerror dup load /uk.co.terryburton.bwipp defineresource pop end @@ -66,7 +65,7 @@ end % --BEGIN RENDERER renlinear-- % --REQUIRES preamble raiseerror-- -%%BeginResource: uk.co.terryburton.bwipp renlinear 0.0 2016042100 76908 76502 +%%BeginResource: uk.co.terryburton.bwipp renlinear 0.0 2017040400 82223 84795 %%BeginData: 237 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -226,15 +225,15 @@ begin txt { {} forall 2 copy s ne exch fn ne or { - 2 copy /s exch def /fn exch def - exch findfont exch scalefont setfont + 2 copy /s exch def /fn exch def + selectfont } { pop pop } ifelse moveto show } forall } { - textfont findfont textsize scalefont setfont + textfont textsize selectfont alttext () eq { /txt [ txt { 0 get {} forall } forall ] def /tstr txt length string def @@ -311,8 +310,8 @@ end % --BEGIN RENDERER renmatrix-- % --REQUIRES preamble raiseerror-- -%%BeginResource: uk.co.terryburton.bwipp renmatrix 0.0 2016042100 54074 54076 -%%BeginData: 66 ASCII Lines +%%BeginResource: uk.co.terryburton.bwipp renmatrix 0.0 2017040400 102784 108937 +%%BeginData: 309 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put @@ -328,6 +327,20 @@ begin /height 1 def /barcolor (unset) def /backgroundcolor (unset) def + /inkspread 0 def + /inkspreadh 0 def + /inkspreadv 0 def + /includetext false def + /txt [] def + /textcolor (unset) def + /textxalign (unset) def + /textyalign (unset) def + /textfont (Courier) def + /textsize 10 def + /textxoffset 0 def + /textyoffset 0 def + /textgaps 0 def + /alttext () def % Apply the renderer options and the user options args {def} forall @@ -337,6 +350,165 @@ begin /height height cvr def /barcolor barcolor cvlit def /backgroundcolor backgroundcolor cvlit def + /inkspread inkspread cvr def + /inkspreadh inkspreadh cvr def + /inkspreadv inkspreadv cvr def + /textcolor textcolor cvlit def + /textxalign textxalign cvlit def + /textyalign textyalign cvlit def + /textfont textfont cvlit def + /textsize textsize cvr def + /textxoffset textxoffset cvr def + /textyoffset textyoffset cvr def + /textgaps textgaps cvr def + /alttext alttext cvlit def + + inkspread 0 ne {/inkspreadh inkspread def} if + inkspread 0 ne {/inkspreadv inkspread def} if + + /xyget { pixx mul add pixs exch get } bind def + /xyinvert { pixx mul add pixs exch 2 copy get 1 xor put } bind def + /mxyget { pixx mul add m exch get 2#001 and } bind def + /mxyset { pixx mul add m exch 3 -1 roll put } bind def + /msetborder { pixx mul add m exch 2 copy get 2#010 or put } bind def + /mborderoff { pixx mul add m exch 2 copy get 2#100 or put } bind def + /misborder { pixx mul add m exch get 2#110 and 2#010 eq } bind def + /mclear { pixx mul add m exch 2 copy get 2#001 and put } bind def + /mclear4 { + 2 copy mclear + 2 copy 1 add mclear + 2 copy exch 1 add exch mclear + 2 copy exch 1 add exch mclear + 1 add exch 1 add exch mclear + } bind def + + /trace { + % Walk the outline of a region emitting edge coordinates of the path + /y exch def /x exch def + % dir 0:right 1:down 2:left 3:up + % hug 0:right 1:left + /dir x 1 add y 1 add mxyget def /hug dir def + /sx x def /sy y def /sdir dir def + mark [x y] { + x 1 add y + x 1 add y 1 add + x y 1 add + x y + 8 dir 2 mul neg roll + /Dy exch def /Dx exch def /D Dx Dy xyget def + /Cy exch def /Cx exch def /C Cx Cy xyget def + /By exch def /Bx exch def /B Bx By xyget def + /Ay exch def /Ax exch def /A Ax Ay xyget def + A B eq { + A C eq {/L} {/R} ifelse + } { + A C eq B D eq and { + A 0 eq hug 0 eq xor {/R} {/F} ifelse + } { + /F + } ifelse + } ifelse + dup /F eq { + pop + dir 0 eq {/x x 1 add def} if + dir 1 eq {/y y 1 add def} if + dir 2 eq {/x x 1 sub def} if + dir 3 eq {/y y 1 sub def} if + hug 0 eq { + Ax Ay msetborder + } { + Bx By msetborder + } ifelse + } { + /L eq { + /dir dir 3 add 4 mod def + hug 1 eq { + Bx By msetborder + Dx Dy mborderoff + } if + } { % R + /dir dir 1 add 4 mod def + hug 0 eq { + Ax Ay msetborder + Cx Cy mborderoff + } if + } ifelse + [x y] + } ifelse + x sx eq y sy eq and dir sdir eq and {exit} if + } loop + counttomark array astore exch pop + + % Invert the interior of the path + /x x 1 add def /y y 1 add def + /t x y mxyget 1 xor def + mark x y { + counttomark 0 eq {exit} if + /y exch def /x exch def + x y mxyget t ne { + 0 x 1 sub -1 0 {dup y misborder {exch pop exit} if pop} for + pixx 1 sub x 1 add 1 pixx 1 sub {dup y misborder {exch pop exit} if pop} for + 1 exch { % From left to right border + /i exch def + i y misborder not { + t i y mxyset + i y xyinvert + } if + i y 1 sub mxyget t ne i y 1 sub misborder not and {i y 1 sub} if + i y 1 add mxyget t ne i y 1 add misborder not and {i y 1 add} if + } for + } if + } loop + pop + + % Walk the path to clear the border information + dup 0 get aload pop /y1 exch def /x1 exch def + dup dup length 1 sub 1 exch getinterval { + aload pop /y2 exch def /x2 exch def + x2 x1 gt { x1 2 x2 1 sub {y1 mclear4} for } if + y2 y1 gt { y1 2 y2 1 sub {x1 exch mclear4} for } if + x2 x1 lt { x1 -2 x2 1 add {y1 mclear4} for } if + y2 y1 lt { y1 -2 y2 1 add {x1 exch mclear4} for } if + /x1 x2 def /y1 y2 def + } forall + + % Discard duplicate final point + dup length 1 sub 0 exch getinterval + + } bind def + + % Pad the bitmap on all sides + /pixs [ + pixx 2 add {0} repeat + 0 pixx pixs length 1 sub { + 0 exch + pixs exch pixx getinterval aload pop + 0 + } for + pixx 2 add {0} repeat + ] def + /pixx pixx 2 add def + /pixy pixy 2 add def + + % Track inverted regions and working space + /m [ pixs length {0} repeat ] def + + % Construct paths by tracing and inverting each dark region + /paths [ + 0 1 pixy 1 sub { + /j exch def + 0 1 pixx 1 sub { + /i exch def + i j xyget 1 eq { + i 1 sub j 1 sub trace + } if + } for + } for + ] def + + % Revert the bitmap size + /pixx pixx 2 sub def + /pixy pixy 2 sub def % Set RGB or CMYK color depending on length of given hex string /setanycolor { @@ -349,28 +521,98 @@ begin } if } bind def - % Draw the image gsave + + % Draw the image + /inkspreadh inkspreadh 2 div def + /inkspreadv inkspreadv 2 div def currentpoint translate width pixx div 72 mul height pixy div 72 mul scale 0 0 moveto pixx 0 lineto pixx pixy lineto 0 pixy lineto closepath - backgroundcolor (unset) ne { gsave backgroundcolor setanycolor fill grestore } if + backgroundcolor (unset) ne { gsave backgroundcolor setanycolor fill grestore } if barcolor (unset) ne { barcolor setanycolor } if - /xyget {pixx mul add get} bind def newpath - 0 1 pixs length 1 sub { - dup pixx mod /x exch def - pixx idiv /y exch def - pixs x y xyget 1 eq { - x pixy y sub 1 sub moveto - 0 1 rlineto - 1 0 rlineto - 0 -1 rlineto - -1 0 rlineto - closepath - } if - } for + paths { + /p exch def + /len p length def + p len 1 sub get aload pop + p 0 get aload pop + 0 1 len 1 sub { % x1 y1 x2 y2 + /i exch def + p i 1 add len mod get aload pop 6 -2 roll % x3 y3 x1 y1 x2 y2 + 5 index inkspreadh + 4 index 4 -1 roll lt {add} {sub} ifelse % y3<y1 ? x2+i : x2-i + 4 1 roll + 4 index inkspreadv + 4 index 4 -1 roll gt {add} {sub} ifelse % x3>x1 ? y2+i : y2-i + 4 -1 roll exch pixy exch sub + i 0 eq {moveto} {lineto} ifelse + } for % x2 y2 x3 y3 + closepath + pop pop pop pop + } forall fill + + % Display the text for elements in the text array + textcolor (unset) ne { textcolor setanycolor } if + includetext { + textxalign (unset) eq textyalign (unset) eq and alttext () eq and { + /s 0 def /fn () def + txt { + {} forall + 2 copy s ne exch fn ne or { + 2 copy /s exch def /fn exch def + selectfont + } { + pop pop + } ifelse + moveto show + } forall + } { + textfont textsize selectfont + alttext () eq { + /txt [ txt { 0 get {} forall } forall ] def + /tstr txt length string def + 0 1 txt length 1 sub { dup txt exch get tstr 3 1 roll put } for + } { + /tstr alttext def + } ifelse + + % Find true ascent of font + tstr length 0 eq { + 0 + } { + gsave + newpath 0 0 moveto (0) false charpath pathbbox + 4 1 roll pop pop pop + grestore + currentfont /PaintType known {currentfont /PaintType get 2 eq} {false} ifelse + currentfont /StrokeWidth known and { + currentfont /StrokeWidth get 2 div 0 exch + currentfont /FontMatrix get dtransform + dup mul exch dup mul add sqrt + add + } if + } ifelse + /textascent exch def + /textwidth tstr stringwidth pop tstr length 1 sub textgaps mul add def + + /textxpos textxoffset x textwidth sub 2 div add def + textxalign (left) eq { /textxpos textxoffset def } if + textxalign (right) eq { /textxpos x textxoffset sub textwidth sub def } if + textxalign (offleft) eq { /textxpos textwidth textxoffset add neg def } if + textxalign (offright) eq { /textxpos x textxoffset add def } if + textxalign (justify) eq textwidth x lt and { + /textxpos 0 def + /textgaps x textwidth sub tstr length 1 sub div def + } if + /textypos textyoffset textascent add 1 add neg def + textyalign (above) eq { /textypos textyoffset pixy add 1 add def } if + textyalign (center) eq { /textypos textyoffset pixy textascent sub 2 div add def } if + textxpos textypos moveto textgaps 0 tstr ashow + } ifelse + } if + grestore end @@ -385,7 +627,7 @@ end % --BEGIN RENDERER renmaximatrix-- % --REQUIRES preamble raiseerror-- -%%BeginResource: uk.co.terryburton.bwipp renmaximatrix 0.0 2016042100 55426 55272 +%%BeginResource: uk.co.terryburton.bwipp renmaximatrix 0.0 2017040400 52341 55461 %%BeginData: 79 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -476,7 +718,7 @@ end % --EXAM: 90200 % --EXOP: includetext guardwhitespace % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp ean5 0.0 2016042100 62897 62576 +%%BeginResource: uk.co.terryburton.bwipp ean5 0.0 2017040400 68958 65237 %%BeginData: 135 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -623,7 +865,7 @@ end % --EXAM: 05 % --EXOP: includetext guardwhitespace % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp ean2 0.0 2016042100 61678 61382 +%%BeginResource: uk.co.terryburton.bwipp ean2 0.0 2017040400 67275 63499 %%BeginData: 120 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -755,7 +997,7 @@ end % --EXAM: 2112345678900 % --EXOP: includetext guardwhitespace % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp ean13 0.0 2016042100 84460 87603 +%%BeginResource: uk.co.terryburton.bwipp ean13 0.0 2017040400 95001 91176 %%BeginData: 215 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -982,7 +1224,7 @@ end % --EXAM: 02345673 % --EXOP: includetext guardwhitespace % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp ean8 0.0 2016042100 81954 85278 +%%BeginResource: uk.co.terryburton.bwipp ean8 0.0 2017040400 91447 87627 %%BeginData: 196 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -1190,7 +1432,7 @@ end % --EXAM: 416000336108 % --EXOP: includetext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp upca 0.0 2016042100 89013 91922 +%%BeginResource: uk.co.terryburton.bwipp upca 0.0 2017040400 100538 100055 %%BeginData: 248 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -1450,7 +1692,7 @@ end % --EXAM: 00123457 % --EXOP: includetext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp upce 0.0 2016042100 92938 99490 +%%BeginResource: uk.co.terryburton.bwipp upce 0.0 2017040400 106367 105719 %%BeginData: 287 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -1749,7 +1991,7 @@ end % --EXAM: 978-1-56581-231-4 52250 % --EXOP: includetext guardwhitespace % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp isbn 0.0 2016042100 97266 100181 +%%BeginResource: uk.co.terryburton.bwipp isbn 0.0 2017040400 104057 106666 %%BeginData: 252 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -2013,7 +2255,7 @@ end % --EXAM: 979-0-2605-3211-3 % --EXOP: includetext guardwhitespace % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp ismn 0.0 2016042100 94206 93526 +%%BeginResource: uk.co.terryburton.bwipp ismn 0.0 2017040400 99901 102499 %%BeginData: 231 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -2256,8 +2498,8 @@ end % --EXAM: 0311-175X 00 17 % --EXOP: includetext guardwhitespace % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp issn 0.0 2016042100 85135 81376 -%%BeginData: 177 ASCII Lines +%%BeginResource: uk.co.terryburton.bwipp issn 0.0 2017040400 89213 88719 +%%BeginData: 176 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put @@ -2297,15 +2539,15 @@ begin issntextyoffset (unset) ne {/issntextyoffset issntextyoffset cvr def} if /height height cvr def /addongap addongap cvr def - + % Split off the ISSN issntxt ( ) search { /issntxt exch def pop /seqvar exch def - } { + } { pop - /seqvar () def + /seqvar (00) def } ifelse % Split off the sequence variant and addon @@ -2315,30 +2557,29 @@ begin /addon exch def } { pop - /addon seqvar def - /seqvar (00) def + /addon () def } ifelse % Validate the input issntxt length 8 ne issntxt length 9 ne and { - /bwipp.issnBadLength (ISSN must be 8 or 9 characters including dash) //raiseerror exec + /bwipp.issnBadLength (ISSN must be 8 or 9 characters including dash, in the format XXXX-XXXX) //raiseerror exec } if issntxt 0 4 getinterval { dup 48 lt exch 57 gt or { - /bwipp.issnBadFormat (ISSN must have the format XXXX-XXXX) //raiseerror exec + /bwipp.issnFirstThroughFourthNotNumeric (ISSN first four characters must be numeral characters) //raiseerror exec } if } forall issntxt 4 1 getinterval (-) ne { - /bwipp.issnBadFormat (ISSN must have the format XXXX-XXXX) //raiseerror exec + /bwipp.issnNeedsDash (ISSN fifth character must be a dash) //raiseerror exec } if issntxt 5 3 getinterval { dup 48 lt exch 57 gt or { - /bwipp.issnBadFormat (ISSN must have the format XXXX-XXXX) //raiseerror exec + /bwipp.issnSixthThroughEighthNotNumeric (ISSN sixth through eighth characters must be numerals) //raiseerror exec } if } forall issntxt length 9 eq { issntxt 8 get dup dup 48 lt exch 57 gt or exch 88 ne and { % Digits or X - /bwipp.issnBadFormat (ISSN must have the format XXXX-XXXX) //raiseerror exec + /bwipp.issnNinthCharacterBadFormat (ISSN ninth character must be a number or the character X) //raiseerror exec } if } if seqvar length 2 ne { @@ -2430,7 +2671,7 @@ begin dontdraw not //renlinear if end - + } bind def /issn dup load /uk.co.terryburton.bwipp defineresource pop end @@ -2445,7 +2686,7 @@ end % --EXAM: Count01234567! % --EXOP: includetext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp code128 0.0 2016042100 118230 128296 +%%BeginResource: uk.co.terryburton.bwipp code128 0.0 2017040400 143323 149453 %%BeginData: 455 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -2912,8 +3153,8 @@ end % --EXAM: (01)95012345678903(3103)000123 % --EXOP: includetext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp gs1-128 0.0 2016042100 77699 77161 -%%BeginData: 157 ASCII Lines +%%BeginResource: uk.co.terryburton.bwipp gs1-128 0.0 2017040400 79997 83024 +%%BeginData: 158 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put @@ -2955,7 +3196,7 @@ begin /height height cvr def /text barcode def - + % Expand ordinals of the form ^NNN to ASCII /expand { /in exch def @@ -2973,25 +3214,26 @@ begin dup out exch j exch putinterval length j add /j exch def out 0 j getinterval exit - } ifelse + } ifelse } loop } bind def - + % Parse out AIs - /ais [] def - /aival 2 dict def + /ais [] def + /vals [] def barcode dup length 1 sub 1 exch getinterval { % loop dup () eq {exit} if (\)) search pop exch pop exch (\() search { - exch pop exch 3 1 roll - } { + exch pop exch 3 1 roll + } { () 3 1 roll } ifelse - [ ais aload pop counttomark 2 add index ] /ais exch def - aival 3 1 roll expand put + [ ais aload pop counttomark 2 add index ] /ais exch def + [ vals aload pop counttomark 1 add index expand ] /vals exch def + pop pop } loop pop @@ -3019,7 +3261,7 @@ begin 0 1 ais length 1 sub { /i exch def /ai ais i get def - /val aival ai get def + /val vals i get def c128 length ai length add val length add array dup 0 c128 putinterval dup c128 length ai [ exch {} forall ] putinterval @@ -3081,7 +3323,7 @@ end % --EXAM: (01) 0 46 01234 56789 3 % --EXOP: includetext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp ean14 0.0 2016042100 69977 69481 +%%BeginResource: uk.co.terryburton.bwipp ean14 0.0 2017040400 71172 70768 %%BeginData: 105 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -3198,7 +3440,7 @@ end % --EXAM: (00) 0 0614141 123456789 0 % --EXOP: includetext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp sscc18 0.0 2016042100 69989 69488 +%%BeginResource: uk.co.terryburton.bwipp sscc18 0.0 2017040400 71184 70775 %%BeginData: 105 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -3315,7 +3557,7 @@ end % --EXAM: THIS IS CODE 39 % --EXOP: includetext includecheck includecheckintext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp code39 0.0 2016042100 67013 66837 +%%BeginResource: uk.co.terryburton.bwipp code39 0.0 2017040400 75290 74970 %%BeginData: 141 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -3468,7 +3710,7 @@ end % --EXAM: Code39 Ext! % --EXOP: includetext includecheck includecheckintext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp code39ext 0.0 2016042100 65588 65334 +%%BeginResource: uk.co.terryburton.bwipp code39ext 0.0 2017040400 71403 71123 %%BeginData: 110 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -3590,7 +3832,7 @@ end % --EXAM: 01234567 % --EXOP: includetext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp code32 0.0 2016042100 63549 63380 +%%BeginResource: uk.co.terryburton.bwipp code32 0.0 2017040400 68684 68425 %%BeginData: 99 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -3701,7 +3943,7 @@ end % --EXAM: 123456 % --EXOP: includetext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp pzn 0.0 2016042100 63596 63384 +%%BeginResource: uk.co.terryburton.bwipp pzn 0.0 2017040400 68931 68597 %%BeginData: 100 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -3813,7 +4055,7 @@ end % --EXAM: THIS IS CODE 93 % --EXOP: includetext includecheck % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp code93 0.0 2016042100 65852 65716 +%%BeginResource: uk.co.terryburton.bwipp code93 0.0 2017040400 73201 72985 %%BeginData: 148 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -3973,7 +4215,7 @@ end % --EXAM: Code93 Ext! % --EXOP: includetext includecheck % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp code93ext 0.0 2016042100 65941 65711 +%%BeginResource: uk.co.terryburton.bwipp code93ext 0.0 2017040400 68324 71604 %%BeginData: 114 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -4099,7 +4341,7 @@ end % --EXAM: 2401234567 % --EXOP: height=0.5 includecheck includetext includecheckintext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp interleaved2of5 0.0 2016042100 65832 65492 +%%BeginResource: uk.co.terryburton.bwipp interleaved2of5 0.0 2017040400 73301 73185 %%BeginData: 150 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -4261,7 +4503,7 @@ end % --EXAM: 0 46 01234 56789 3 % --EXOP: includetext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp itf14 0.0 2016042100 65819 65737 +%%BeginResource: uk.co.terryburton.bwipp itf14 0.0 2017040400 68114 71278 %%BeginData: 109 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -4382,7 +4624,7 @@ end % --EXAM: 563102430313 % --EXOP: includetext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp identcode 0.0 2016042100 62754 62576 +%%BeginResource: uk.co.terryburton.bwipp identcode 0.0 2017040400 64217 67381 %%BeginData: 91 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -4485,7 +4727,7 @@ end % --EXAM: 21348075016401 % --EXOP: includetext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp leitcode 0.0 2016042100 62746 62572 +%%BeginResource: uk.co.terryburton.bwipp leitcode 0.0 2017040400 64209 67377 %%BeginData: 91 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -4588,8 +4830,8 @@ end % --EXAM: (01)24012345678905 % --EXOP: % --RNDR: renlinear renmatrix -%%BeginResource: uk.co.terryburton.bwipp databaromni 0.0 2016042100 112081 118257 -%%BeginData: 418 ASCII Lines +%%BeginResource: uk.co.terryburton.bwipp databaromni 0.0 2017040400 131912 137574 +%%BeginData: 420 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put @@ -4607,6 +4849,7 @@ begin /height 33 72 div def /linkage false def /format (omni) def + /barxmult 33 def % Parse the input options options type /stringtype eq { @@ -4621,6 +4864,7 @@ begin format (truncated) eq {/height 13 72 div def} if /height height cvr def + /barxmult barxmult cvi def % Validate the input barcode 0 4 getinterval (\(01\)) ne { @@ -4978,11 +5222,11 @@ begin sep3 19 [ 0 0 0 0 0 0 0 0 0 0 1 0 0 ] putinterval } if /pixs [ - 33 {top aload pop} repeat + barxmult {top aload pop} repeat sep1 aload pop sep2 aload pop sep3 aload pop - 33 {bot aload pop} repeat + barxmult {bot aload pop} repeat ] def /pixy pixs length 50 idiv def } if @@ -5018,7 +5262,7 @@ end % --EXAM: (01)24012345678905 % --EXOP: % --RNDR: renmatrix -%%BeginResource: uk.co.terryburton.bwipp databarstacked 0.0 2016042100 67872 71029 +%%BeginResource: uk.co.terryburton.bwipp databarstacked 0.0 2017040400 71113 67516 %%BeginData: 73 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -5103,7 +5347,7 @@ end % --EXAM: (01)24012345678905 % --EXOP: % --RNDR: renmatrix -%%BeginResource: uk.co.terryburton.bwipp databarstackedomni 0.0 2016042100 67972 71109 +%%BeginResource: uk.co.terryburton.bwipp databarstackedomni 0.0 2017040400 71213 67596 %%BeginData: 73 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -5188,7 +5432,7 @@ end % --EXAM: (01)24012345678905 % --EXOP: % --RNDR: renlinear renmatrix -%%BeginResource: uk.co.terryburton.bwipp databartruncated 0.0 2016042100 67898 71045 +%%BeginResource: uk.co.terryburton.bwipp databartruncated 0.0 2017040400 71139 67532 %%BeginData: 73 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -5273,7 +5517,7 @@ end % --EXAM: (01)15012345678907 % --EXOP: % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp databarlimited 0.0 2016042100 83260 86093 +%%BeginResource: uk.co.terryburton.bwipp databarlimited 0.0 2017040400 96545 95706 %%BeginData: 276 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -5561,8 +5805,8 @@ end % --EXAM: (01)95012345678903(3103)000123 % --EXOP: % --RNDR: renlinear renmatrix -%%BeginResource: uk.co.terryburton.bwipp databarexpanded 0.0 2016042100 197224 210202 -%%BeginData: 871 ASCII Lines +%%BeginResource: uk.co.terryburton.bwipp databarexpanded 0.0 2017040400 245708 247229 +%%BeginData: 880 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put @@ -5581,6 +5825,7 @@ begin /format (expanded) def /segments -1 def /linkage false def + /barxmult 34 def % Parse the input options options type /stringtype eq { @@ -5595,6 +5840,7 @@ begin /height height cvr def /segments segments cvi def + /barxmult barxmult cvi def segments -1 eq { /segments format (expandedstacked) eq {4} {22} ifelse def @@ -5617,36 +5863,37 @@ begin dup out exch j exch putinterval length j add /j exch def out 0 j getinterval exit - } ifelse + } ifelse } loop } bind def - + % Parse out AIs - /ais [] def - /aival 2 dict def + /ais [] def + /vals [] def barcode dup length 1 sub 1 exch getinterval { % loop dup () eq {exit} if (\)) search pop exch pop exch (\() search { - exch pop exch 3 1 roll - } { + exch pop exch 3 1 roll + } { () 3 1 roll - } ifelse - [ ais aload pop counttomark 2 add index ] /ais exch def - aival 3 1 roll expand put + } ifelse + [ ais aload pop counttomark 2 add index ] /ais exch def + [ vals aload pop counttomark 1 add index expand ] /vals exch def + pop pop } loop pop - + % Method selection { % common exit - + % (01)9...(3103)... ais length 2 eq { - ais 0 get (01) eq ais 1 get (3103) eq and { - aival (01) get 0 1 getinterval (9) eq aival (3103) get cvi 32767 le and { - (0100) false exit + ais 0 get (01) eq ais 1 get (3103) eq and { + vals 0 get 0 1 getinterval (9) eq vals 1 get cvi 32767 le and { + (0100) false exit } if } if } if @@ -5654,7 +5901,7 @@ begin % (01)9...(3202)... ais length 2 eq { ais 0 get (01) eq ais 1 get (3202) eq and { - aival (01) get 0 1 getinterval (9) eq aival (3202) get cvi 9999 le and { + vals 0 get 0 1 getinterval (9) eq vals 1 get cvi 9999 le and { (0101) false exit } if } if @@ -5663,7 +5910,7 @@ begin % (01)9...(3203)... ais length 2 eq { ais 0 get (01) eq ais 1 get (3203) eq and { - aival (01) get 0 1 getinterval (9) eq aival (3203) get cvi 22767 le and { + vals 0 get 0 1 getinterval (9) eq vals 1 get cvi 22767 le and { (0101) false exit } if } if @@ -5680,9 +5927,9 @@ begin } ifelse ais 0 get (01) eq ai310x ai320x or and aibad not and { ais length 3 eq { - aival (01) get 0 1 getinterval (9) eq - aival ais 1 get get cvi 99999 le and - aival ais 2 get get cvi 999999 le and { + vals 0 get 0 1 getinterval (9) eq + vals 1 get cvi 99999 le and + vals 2 cvi 999999 le and { ai310x ais 2 get (11) eq and { (0111000) false exit } if ai320x ais 2 get (11) eq and { (0111001) false exit } if ai310x ais 2 get (13) eq and { (0111010) false exit } if @@ -5693,8 +5940,8 @@ begin ai320x ais 2 get (17) eq and { (0111111) false exit } if } if } { - aival (01) get 0 1 getinterval (9) eq - aival ais 1 get get cvi 99999 le and { + vals 0 get 0 1 getinterval (9) eq + vals 1 get cvi 99999 le and { ai310x { (0111000) false exit } if ai320x { (0111001) false exit } if } if @@ -5706,7 +5953,7 @@ begin ais length 2 ge { /ai392x false 3920 1 3923 {10 4 string cvrs ais 1 get eq or} for def ais 0 get (01) eq ai392x and { - aival (01) get 0 1 getinterval (9) eq { (01100) true exit } if + vals 0 get 0 1 getinterval (9) eq { (01100) true exit } if } if } if @@ -5714,7 +5961,7 @@ begin ais length 2 ge { /ai393x false 3930 1 3933 {10 4 string cvrs ais 1 get eq or} for def ais 0 get (01) eq ai393x and { - aival (01) get 0 1 getinterval (9) eq { (01101) true exit } if + vals 0 get 0 1 getinterval (9) eq { (01101) true exit } if } if } if @@ -5754,46 +6001,49 @@ begin } if method (1) eq { - /cdf aival (01) get 0 13 getinterval conv13to44 def + /cdf vals 0 get 0 13 getinterval conv13to44 def /cdf [ cdf {48 sub} forall ] def /gpf [] def - /ais ais 1 ais length 1 sub getinterval def + /ais ais 1 ais length 1 sub getinterval def + /vals vals 1 vals length 1 sub getinterval def } if method (0100) eq { /cdf 55 string def - cdf 0 aival (01) get 1 12 getinterval conv12to40 putinterval - cdf 40 aival (3103) get cvi 15 tobin putinterval + cdf 0 vals 0 get 1 12 getinterval conv12to40 putinterval + cdf 40 vals 1 get cvi 15 tobin putinterval /cdf [ cdf {48 sub} forall ] def /gpf [] def /ais [] def + /vals [] def } if method (0101) eq { /cdf 55 string def - cdf 0 aival (01) get 1 12 getinterval conv12to40 putinterval + cdf 0 vals 0 get 1 12 getinterval conv12to40 putinterval ais 1 get (3202) eq { - aival (3202) get cvi 15 tobin + vals 1 get cvi 15 tobin } { - aival (3203) get cvi 10000 add 15 tobin + vals 1 get cvi 10000 add 15 tobin } ifelse cdf exch 40 exch putinterval /cdf [ cdf {48 sub} forall ] def /gpf [] def /ais [] def + /vals [] def } if method length 7 eq { /cdf 76 string def - cdf 0 aival (01) get 1 12 getinterval conv12to40 putinterval + cdf 0 vals 0 get 1 12 getinterval conv12to40 putinterval 6 string dup 0 ais 1 get 3 1 getinterval putinterval - dup aival ais 1 get get 1 5 getinterval 1 exch putinterval cvi 20 tobin + dup vals 1 get 1 5 getinterval 1 exch putinterval cvi 20 tobin cdf exch 40 exch putinterval ais length 3 eq { - aival ais 2 get get + vals 2 get dup 0 2 getinterval cvi 384 mul exch dup 2 2 getinterval cvi 1 sub 32 mul exch - 4 2 getinterval cvi add add + 4 2 getinterval cvi add add } { 38400 } ifelse @@ -5801,25 +6051,28 @@ begin /cdf [ cdf {48 sub} forall ] def /gpf [] def /ais [] def + /vals [] def } if method (01100) eq { /cdf 42 string def - cdf 0 aival (01) get 1 12 getinterval conv12to40 putinterval - cdf 40 ais 1 get 3 1 getinterval cvi 2 tobin putinterval + cdf 0 vals 0 get 1 12 getinterval conv12to40 putinterval + cdf 40 ais 1 get 3 1 getinterval cvi 2 tobin putinterval /cdf [ cdf {48 sub} forall ] def - /gpf [ aival ais 1 get get {} forall ] def - /ais ais 2 ais length 2 sub getinterval def + /gpf [ vals 1 get {} forall ] def + /ais ais 2 ais length 2 sub getinterval def + /vals vals 2 vals length 2 sub getinterval def } if method (01101) eq { /cdf 52 string def - cdf 0 aival (01) get 1 12 getinterval conv12to40 putinterval - cdf 40 ais 1 get 3 1 getinterval cvi 2 tobin putinterval - cdf 42 aival ais 1 get get 0 3 getinterval cvi 10 tobin putinterval + cdf 0 vals 0 get 1 12 getinterval conv12to40 putinterval + cdf 40 ais 1 get 3 1 getinterval cvi 2 tobin putinterval + cdf 42 vals 1 get 0 3 getinterval cvi 10 tobin putinterval /cdf [ cdf {48 sub} forall ] def - /gpf [ aival ais 1 get get dup length 3 sub 3 exch getinterval {} forall ] def - /ais ais 2 ais length 2 sub getinterval def + /gpf [ vals 1 get dup length 3 sub 3 exch getinterval {} forall ] def + /ais ais 2 ais length 2 sub getinterval def + /vals vals 2 vals length 2 sub getinterval def } if % Variable length symbol field @@ -5891,7 +6144,7 @@ begin 0 1 ais length 1 sub { /i exch def /ai ais i get def - /val aival ai get def + /val vals i get def gpf length ai length add val length add array dup 0 gpf putinterval dup gpf length ai [ exch {} forall ] putinterval @@ -6406,7 +6659,7 @@ begin r 0 ne { seps r get aload pop } if - 34 {rows r get aload pop} repeat + barxmult {rows r get aload pop} repeat r numrows 1 sub ne { seps r get aload pop sep aload pop @@ -6444,7 +6697,7 @@ end % --EXAM: (01)95012345678903(3103)000123 % --EXOP: segments=4 % --RNDR: renlinear renmatrix -%%BeginResource: uk.co.terryburton.bwipp databarexpandedstacked 0.0 2016042100 63589 66857 +%%BeginResource: uk.co.terryburton.bwipp databarexpandedstacked 0.0 2017040400 62326 62296 %%BeginData: 43 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -6493,13 +6746,158 @@ end %%EndResource % --END ENCODER databarexpandedstacked-- +% --BEGIN ENCODER gs1northamericancoupon-- +% --REQUIRES preamble raiseerror renlinear renmatrix databarexpanded databarexpandedstacked-- +% --DESC: GS1 North American Coupon +% --EXAM: (8110)106141416543213500110000310123196000 +% --EXOP: includetext segments=8 +% --RNDR: renlinear renmatrix +%%BeginResource: uk.co.terryburton.bwipp gs1northamericancoupon 0.0 2017040400 84603 84322 +%%BeginData: 133 ASCII Lines +/setpacking where {pop currentpacking true setpacking} if +1 dict +dup /raiseerror dup /uk.co.terryburton.bwipp findresource put +dup /renmatrix dup /uk.co.terryburton.bwipp findresource put +dup /databarexpandedstacked dup /uk.co.terryburton.bwipp findresource put +begin +/gs1northamericancoupon { + + 20 dict begin % Confine variables to local scope + + /options exch def % We are given an option string + /barcode exch def % We are given a barcode string + + /dontdraw false def + + /includetext false def % Enable/disable coupon text + /coupontextfont /Helvetica def + /coupontextsize 9 def + /coupontextxoffset (unset) def + /coupontextyoffset (unset) def + + % Parse the input options + options type /stringtype eq { + 1 dict begin + options { + token false eq {exit} if dup length string cvs (=) search + true eq {cvlit exch pop exch def} {cvlit true def} ifelse + } loop + currentdict end /options exch def + } if + options {def} forall + + /coupontextfont coupontextfont cvlit def + /coupontextsize coupontextsize cvr def + coupontextxoffset (unset) ne {/coupontextxoffset coupontextxoffset cvr def} if + coupontextyoffset (unset) ne {/coupontextyoffset coupontextyoffset cvr def} if + + % Expand ordinals of the form ^NNN to ASCII + /expand { + /in exch def + /out in length string def + /j 0 def + in + { % loop + (^) search { + dup out exch j exch putinterval + length j add 1 add /j exch def + pop + dup 0 3 getinterval cvi out exch j 1 sub exch put + dup length 3 sub 3 exch getinterval + } { + dup out exch j exch putinterval + length j add /j exch def + out 0 j getinterval exit + } ifelse + } loop + } bind def + + % Parse out AIs + /ais [] def + /vals [] def + barcode dup length 1 sub 1 exch getinterval + { % loop + dup () eq {exit} if + (\)) search pop + exch pop + exch (\() search { + exch pop exch 3 1 roll + } { + () 3 1 roll + } ifelse + [ ais aload pop counttomark 2 add index ] /ais exch def + [ vals aload pop counttomark 1 add index expand ] /vals exch def + pop pop + } loop + pop + + % Validate the AI structure + ais length 1 ne { + /bwipp.gs1northamericancouponBadAIStructure (A GS1 North American Coupon should consist of a single AI (8110)) //raiseerror exec + } if + ais 0 get (8110) ne { + /bwipp.gs1northamericancouponBadAIStructure (A GS1 North American Coupon should consist of a single AI (8110)) //raiseerror exec + } if + + % Parse out the Company Prefix and Offer Code + /val vals 0 get def + /vli val 0 get 48 sub def + vli 0 lt vli 6 gt or { + /bwipp.gs1northamericancouponBadVLI (The AI (8110) data should start with a Company Prefix length indicator in the range 0 to 6) //raiseerror exec + } if + /gcp val 1 vli 6 add getinterval def + /cod val vli 7 add 6 getinterval def + /coupontext gcp length 7 add string def + coupontext 0 gcp putinterval + coupontext gcp length (-) putinterval + coupontext gcp length 1 add cod putinterval + + % Get the result of encoding with databarexpandedstacked + options (dontdraw) true put + + /args barcode options //databarexpandedstacked exec def + + % Add the coupon text + includetext { + coupontextxoffset (unset) eq { + /coupontextxoffset 0 def + } if + coupontextyoffset (unset) eq { + /coupontextyoffset args (height) get 72 mul 3 add def + } if + args (txt) known { + /txt args (txt) get def + /newtxt txt length 1 add array def + newtxt 0 txt putinterval + newtxt newtxt length 1 sub [coupontext coupontextxoffset coupontextyoffset coupontextfont coupontextsize] put + args (txt) newtxt put + } { + args (txt) [ [coupontext coupontextxoffset coupontextyoffset coupontextfont coupontextsize] ] put + } ifelse + } if + + args (opt) options put + args + + dontdraw not //renmatrix if + + end + +} bind def +/gs1northamericancoupon dup load /uk.co.terryburton.bwipp defineresource pop +end +/setpacking where {pop setpacking} if +%%EndData +%%EndResource +% --END ENCODER gs1northamericancoupon-- + % --BEGIN ENCODER pharmacode-- % --REQUIRES preamble raiseerror renlinear-- % --DESC: Pharmaceutical Binary Code % --EXAM: 117480 % --EXOP: showborder % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp pharmacode 0.0 2016042100 60269 60124 +%%BeginResource: uk.co.terryburton.bwipp pharmacode 0.0 2017040400 65042 61361 %%BeginData: 91 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -6602,7 +7000,7 @@ end % --EXAM: 117480 % --EXOP: includetext showborder % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp pharmacode2 0.0 2016042100 60956 60646 +%%BeginResource: uk.co.terryburton.bwipp pharmacode2 0.0 2017040400 65777 62019 %%BeginData: 96 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -6710,7 +7108,7 @@ end % --EXAM: 01234567 % --EXOP: includetext includecheck includecheckintext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp code2of5 0.0 2016042100 67430 67109 +%%BeginResource: uk.co.terryburton.bwipp code2of5 0.0 2017040400 75739 71770 %%BeginData: 150 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -6872,7 +7270,7 @@ end % --EXAM: 01234567 % --EXOP: includetext includecheck includecheckintext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp industrial2of5 0.0 2016042100 57882 57606 +%%BeginResource: uk.co.terryburton.bwipp industrial2of5 0.0 2017040400 57761 61035 %%BeginData: 55 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -6939,7 +7337,7 @@ end % --EXAM: 01234567 % --EXOP: includetext includecheck includecheckintext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp iata2of5 0.0 2016042100 57852 57582 +%%BeginResource: uk.co.terryburton.bwipp iata2of5 0.0 2017040400 57731 61011 %%BeginData: 55 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -7006,7 +7404,7 @@ end % --EXAM: 01234567 % --EXOP: includetext includecheck includecheckintext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp matrix2of5 0.0 2016042100 57862 57590 +%%BeginResource: uk.co.terryburton.bwipp matrix2of5 0.0 2017040400 57741 61019 %%BeginData: 55 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -7073,7 +7471,7 @@ end % --EXAM: 01234567 % --EXOP: includetext includecheck includecheckintext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp coop2of5 0.0 2016042100 57852 57582 +%%BeginResource: uk.co.terryburton.bwipp coop2of5 0.0 2017040400 57731 61011 %%BeginData: 55 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -7140,7 +7538,7 @@ end % --EXAM: 01234567 % --EXOP: includetext includecheck includecheckintext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp datalogic2of5 0.0 2016042100 57877 57602 +%%BeginResource: uk.co.terryburton.bwipp datalogic2of5 0.0 2017040400 57756 61031 %%BeginData: 55 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -7207,7 +7605,7 @@ end % --EXAM: 0123456789 % --EXOP: includetext includecheck includecheckintext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp code11 0.0 2016042100 69086 68582 +%%BeginResource: uk.co.terryburton.bwipp code11 0.0 2017040400 78331 78011 %%BeginData: 158 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -7377,7 +7775,7 @@ end % --EXAM: BC412 % --EXOP: semi includetext includecheckintext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp bc412 0.0 2016042100 64995 64541 +%%BeginResource: uk.co.terryburton.bwipp bc412 0.0 2017040400 72256 72010 %%BeginData: 148 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -7537,7 +7935,7 @@ end % --EXAM: A0123456789B % --EXOP: includetext includecheck includecheckintext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp rationalizedCodabar 0.0 2016042100 69398 68906 +%%BeginResource: uk.co.terryburton.bwipp rationalizedCodabar 0.0 2017040400 78699 78295 %%BeginData: 156 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -7705,7 +8103,7 @@ end % --EXAM: 0123456709498765432101234567891 % --EXOP: barcolor=FF0000 % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp onecode 0.0 2016042100 101896 104906 +%%BeginResource: uk.co.terryburton.bwipp onecode 0.0 2017040400 113701 113359 %%BeginData: 335 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -8052,7 +8450,7 @@ end % --EXAM: 01234 % --EXOP: includetext includecheckintext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp postnet 0.0 2016042100 65689 65439 +%%BeginResource: uk.co.terryburton.bwipp postnet 0.0 2017040400 73030 72820 %%BeginData: 140 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -8204,7 +8602,7 @@ end % --EXAM: 01234567890 % --EXOP: includetext includecheckintext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp planet 0.0 2016042100 65565 65215 +%%BeginResource: uk.co.terryburton.bwipp planet 0.0 2017040400 72826 72620 %%BeginData: 141 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -8357,7 +8755,7 @@ end % --EXAM: LE28HS9Z % --EXOP: includetext barcolor=FF0000 % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp royalmail 0.0 2016042100 66136 65853 +%%BeginResource: uk.co.terryburton.bwipp royalmail 0.0 2017040400 73773 73626 %%BeginData: 145 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -8514,7 +8912,7 @@ end % --EXAM: 5956439111ABA 9 % --EXOP: includetext custinfoenc=character % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp auspost 0.0 2016042100 75628 75331 +%%BeginResource: uk.co.terryburton.bwipp auspost 0.0 2017040400 85865 85800 %%BeginData: 202 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -8728,7 +9126,7 @@ end % --EXAM: 1231FZ13XHS % --EXOP: includetext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp kix 0.0 2016042100 61942 61672 +%%BeginResource: uk.co.terryburton.bwipp kix 0.0 2017040400 67923 64189 %%BeginData: 111 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -8851,7 +9249,7 @@ end % --EXAM: 6540123789-A-K-Z % --EXOP: includetext includecheckintext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp japanpost 0.0 2016042100 66345 66129 +%%BeginResource: uk.co.terryburton.bwipp japanpost 0.0 2017040400 74350 74174 %%BeginData: 162 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -9025,7 +9423,7 @@ end % --EXAM: 0123456789 % --EXOP: includetext includecheck includecheckintext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp msi 0.0 2016042100 71052 70834 +%%BeginResource: uk.co.terryburton.bwipp msi 0.0 2017040400 77937 77655 %%BeginData: 139 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -9176,7 +9574,7 @@ end % --EXAM: 01234ABCD % --EXOP: includetext includecheckintext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp plessey 0.0 2016042100 67754 67457 +%%BeginResource: uk.co.terryburton.bwipp plessey 0.0 2017040400 75943 75566 %%BeginData: 146 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -9334,7 +9732,7 @@ end % --EXAM: ABCDEF % --EXOP: includetext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp telepen 0.0 2016042100 68624 68368 +%%BeginResource: uk.co.terryburton.bwipp telepen 0.0 2017040400 76901 76597 %%BeginData: 173 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -9519,7 +9917,7 @@ end % --EXAM: 01234567 % --EXOP: includetext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp telepennumeric 0.0 2016042100 57870 57594 +%%BeginResource: uk.co.terryburton.bwipp telepennumeric 0.0 2017040400 57741 61015 %%BeginData: 55 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -9586,7 +9984,7 @@ end % --EXAM: ABC123 % --EXOP: version=b inkspread=-0.5 parsefnc includetext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp posicode 0.0 2016042100 106927 109835 +%%BeginResource: uk.co.terryburton.bwipp posicode 0.0 2017040400 128220 127472 %%BeginData: 423 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -10021,8 +10419,8 @@ end % --EXAM: CODABLOCK F 34567890123456789010040digit % --EXOP: columns=8 % --RNDR: renmatrix -%%BeginResource: uk.co.terryburton.bwipp codablockf 0.0 2016042100 126266 132420 -%%BeginData: 521 ASCII Lines +%%BeginResource: uk.co.terryburton.bwipp codablockf 0.0 2017040400 157635 163565 +%%BeginData: 520 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put @@ -10040,7 +10438,6 @@ begin /columns 8 def /rowheight 10 def /sepheight 1 def - /encoding (auto) def /parse false def /parsefnc false def @@ -10554,7 +10951,7 @@ end % --EXAM: Abcd-1234567890-wxyZ % --EXOP: % --RNDR: renmatrix -%%BeginResource: uk.co.terryburton.bwipp code16k 0.0 2016042100 147911 164544 +%%BeginResource: uk.co.terryburton.bwipp code16k 0.0 2017040400 189660 202445 %%BeginData: 744 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -11310,7 +11707,7 @@ end % --EXAM: MULTIPLE ROWS IN CODE 49 % --EXOP: % --RNDR: renmatrix -%%BeginResource: uk.co.terryburton.bwipp code49 0.0 2016042100 218104 234960 +%%BeginResource: uk.co.terryburton.bwipp code49 0.0 2017040400 291373 297357 %%BeginData: 1076 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -12398,7 +12795,7 @@ end % --EXAM: 3493 % --EXOP: height=0.5 includetext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp channelcode 0.0 2016042100 68302 68105 +%%BeginResource: uk.co.terryburton.bwipp channelcode 0.0 2017040400 74649 74470 %%BeginData: 149 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -12559,7 +12956,7 @@ end % --EXAM: 11099 % --EXOP: inkspread=-0.25 showborder borderleft=0 borderright=0 % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp flattermarken 0.0 2016042100 59248 59148 +%%BeginResource: uk.co.terryburton.bwipp flattermarken 0.0 2017040400 63805 60185 %%BeginData: 93 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -12664,7 +13061,7 @@ end % --EXAM: 331132131313411122131311333213114131131221323 % --EXOP: height=0.5 % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp raw 0.0 2016042100 55514 55371 +%%BeginResource: uk.co.terryburton.bwipp raw 0.0 2017040400 58495 55088 %%BeginData: 52 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -12728,7 +13125,7 @@ end % --EXAM: FATDAFTDAD % --EXOP: % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp daft 0.0 2016042100 58288 58222 +%%BeginResource: uk.co.terryburton.bwipp daft 0.0 2017040400 62389 58827 %%BeginData: 76 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -12816,7 +13213,7 @@ end % --EXAM: fima % --EXOP: backgroundcolor=DD000011 % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp symbol 0.0 2016042100 58044 57965 +%%BeginResource: uk.co.terryburton.bwipp symbol 0.0 2017040400 61969 58378 %%BeginData: 72 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -12900,7 +13297,7 @@ end % --EXAM: This is PDF417 % --EXOP: columns=2 % --RNDR: renmatrix -%%BeginResource: uk.co.terryburton.bwipp pdf417 0.0 2016042100 188276 197810 +%%BeginResource: uk.co.terryburton.bwipp pdf417 0.0 2017040400 225385 234487 %%BeginData: 873 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -13785,7 +14182,7 @@ end % --EXAM: This is compact PDF417 % --EXOP: columns=2 % --RNDR: renmatrix -%%BeginResource: uk.co.terryburton.bwipp pdf417compact 0.0 2016042100 60668 60355 +%%BeginResource: uk.co.terryburton.bwipp pdf417compact 0.0 2017040400 59527 59274 %%BeginData: 43 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -13840,7 +14237,7 @@ end % --EXAM: MicroPDF417 % --EXOP: % --RNDR: renmatrix -%%BeginResource: uk.co.terryburton.bwipp micropdf417 0.0 2016042100 201094 213914 +%%BeginResource: uk.co.terryburton.bwipp micropdf417 0.0 2017040400 241907 247375 %%BeginData: 959 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -14811,8 +15208,8 @@ end % --EXAM: This is Data Matrix! % --EXOP: % --RNDR: renmatrix -%%BeginResource: uk.co.terryburton.bwipp datamatrix 0.0 2016042100 199528 218903 -%%BeginData: 871 ASCII Lines +%%BeginResource: uk.co.terryburton.bwipp datamatrix 0.0 2017040400 258183 263444 +%%BeginData: 889 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put @@ -14875,6 +15272,19 @@ begin } loop } if + % Macro 05/06 compression of [)>{RS}05/06{GS}...{RS}{EOT} structured data + /mac05comp false def + /mac06comp false def + barcode length 9 ge { + barcode 0 7 getinterval + dup ([\)>\03605\035) eq + exch ([\)>\03606\035) eq or + barcode barcode length 2 sub 2 getinterval (\036\004) eq and { + barcode 5 get 53 eq {/mac05comp} {/mac06comp} ifelse true def + /barcode barcode 7 barcode length 9 sub getinterval def + } if + } if + /barlen barcode length def % Convert input into bytes accounting for FNC characters @@ -14902,6 +15312,11 @@ begin /j j 1 add def } loop /msg msg 0 j getinterval def + + % Prefix the Macro 05/06 compression indicator + mac05comp { /msg [ m05 msg aload pop ] def } if + mac06comp { /msg [ m06 msg aload pop ] def } if + /msglen msg length def % Basic metrics for the each symbol @@ -15694,7 +16109,7 @@ end % --EXAM: 1234 % --EXOP: % --RNDR: renmatrix -%%BeginResource: uk.co.terryburton.bwipp datamatrixrectangular 0.0 2016042100 60716 60395 +%%BeginResource: uk.co.terryburton.bwipp datamatrixrectangular 0.0 2017040400 59583 59426 %%BeginData: 43 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -15749,8 +16164,8 @@ end % --EXAM: http://goo.gl/0bis % --EXOP: eclevel=M % --RNDR: renmatrix -%%BeginResource: uk.co.terryburton.bwipp qrcode 0.0 2016042100 267379 277512 -%%BeginData: 1019 ASCII Lines +%%BeginResource: uk.co.terryburton.bwipp qrcode 0.0 2017040400 322089 326433 +%%BeginData: 1028 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put @@ -15857,6 +16272,7 @@ begin [ 16#20 16#24 16#25 16#2A 16#2B 16#2D 16#2E 16#2F 16#3A 16#41 1 16#5A {} for + fn1 ] {-1} forall >> def @@ -16070,7 +16486,7 @@ begin [ 6 7 8 e e 3 4] AbeforeB {A exit} if [ 1 1 1 e 1 1 1] AbeforeE {A exit} if numA 1 ge { - ver vM1 ne ver vM2 ne and {B} {A} ifelse exit + ver vM2 ne {B} {A} ifelse exit } if [ 4 4 5 e e 2 3] NbeforeB {N exit} if [ 1 1 1 e e 1 1] NbeforeB {B exit} if @@ -16100,19 +16516,22 @@ begin [13 15 17 e 5 7 9] NbeforeA {N exit} if [13 17 18 e e 7 9] NbeforeB {N exit} if [ 7 8 9 e 3 4 5] NbeforeE {N exit} if - A exit + numA 1 ge numN 1 ge or {A exit} if + B exit } if mode N eq { numK 1 ge {K exit} if numB 1 ge {B exit} if numA 1 ge {A exit} if - N exit + numN 1 ge {N exit} if + B exit } if mode K eq { numB 1 ge {B exit} if numA 1 ge {A exit} if numN 1 ge {N exit} if - K exit + numK 1 ge {K exit} if + B exit } if } loop dup K eq fnc1first and {pop B} if % No kanji with fnc1first @@ -16507,12 +16926,12 @@ begin versionmap { { {} forall qmv pixs exch 0 put } forall } forall - - % Solitary dark module in full symbols + + % Reserve the solitary dark module in full symbols format (full) eq { - pixs 8 size 8 sub qmv 1 put + pixs 8 size 8 sub qmv 0 put } if - + % Calculate the mask patterns format (full) eq { /maskfuncs [ @@ -16705,7 +17124,12 @@ begin } ifelse } for /pixs bestsym def - + + % Set the solitary dark module in full symbols + format (full) eq { + pixs 8 size 8 sub qmv 1 put + } if + % Add the format information format (full) eq { /fmtvals [ @@ -16780,7 +17204,7 @@ end % --EXAM: 1234 % --EXOP: % --RNDR: renmatrix -%%BeginResource: uk.co.terryburton.bwipp microqrcode 0.0 2016042100 60576 60353 +%%BeginResource: uk.co.terryburton.bwipp microqrcode 0.0 2017040400 59531 59384 %%BeginData: 43 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -16835,7 +17259,7 @@ end % --EXAM: [)>^03001^02996152382802^029840^029001^0291Z00004951^029UPSN^02906X610^029159^0291234567^0291/1^029^029Y^029634 ALPHA DR^029PITTSBURGH^029PA^029^004 % --EXOP: mode=2 parse % --RNDR: renmaximatrix -%%BeginResource: uk.co.terryburton.bwipp maxicode 0.0 2016042100 116961 123452 +%%BeginResource: uk.co.terryburton.bwipp maxicode 0.0 2017040400 141526 147393 %%BeginData: 564 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -17411,7 +17835,7 @@ end % --EXAM: This is Aztec Code % --EXOP: format=full % --RNDR: renmatrix -%%BeginResource: uk.co.terryburton.bwipp azteccode 0.0 2016042100 163082 186690 +%%BeginResource: uk.co.terryburton.bwipp azteccode 0.0 2017040400 209943 222599 %%BeginData: 679 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -18102,7 +18526,7 @@ end % --EXAM: 1234 % --EXOP: % --RNDR: renmatrix -%%BeginResource: uk.co.terryburton.bwipp azteccodecompact 0.0 2016042100 60604 60376 +%%BeginResource: uk.co.terryburton.bwipp azteccodecompact 0.0 2017040400 59559 59303 %%BeginData: 43 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -18157,7 +18581,7 @@ end % --EXAM: 1 % --EXOP: % --RNDR: renmatrix -%%BeginResource: uk.co.terryburton.bwipp aztecrune 0.0 2016042100 60573 60352 +%%BeginResource: uk.co.terryburton.bwipp aztecrune 0.0 2017040400 59528 59279 %%BeginData: 43 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -18212,8 +18636,8 @@ end % --EXAM: Code One % --EXOP: % --RNDR: renmatrix -%%BeginResource: uk.co.terryburton.bwipp codeone 0.0 2016042100 190508 210074 -%%BeginData: 851 ASCII Lines +%%BeginResource: uk.co.terryburton.bwipp codeone 0.0 2017040400 241249 250071 +%%BeginData: 856 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put @@ -18339,6 +18763,14 @@ begin cws exch i exch put } for + % Basic metrics for the each symbol + % ver row col dcol dcws rscw rsbl ro ri rl + /metrics [ + [ (S-10) 8 11 10 4 4 1 99 99 99 ] + [ (S-20) 8 21 20 8 8 1 99 99 99 ] + [ (S-30) 8 31 30 12 12 1 99 99 99 ] + ] def + } { % Standard and type-T % Convert input into bytes accounting for FNC characters @@ -18377,9 +18809,6 @@ begin [ (F) 70 76 68 370 140 2 4 22 31 ] [ (G) 104 98 88 732 280 4 6 21 47 ] [ (H) 148 134 120 1480 560 8 6 20 69 ] - [ (S-10) 8 11 10 4 4 1 99 99 99 ] - [ (S-20) 8 21 20 8 8 1 99 99 99 ] - [ (S-30) 8 31 30 12 12 1 99 99 99 ] [ (T-16) 16 17 16 10 10 1 99 99 99 ] [ (T-32) 16 33 32 24 16 1 99 99 99 ] [ (T-48) 16 49 48 38 22 1 99 99 99 ] @@ -19075,7 +19504,7 @@ end % --EXAM: This is Han Xin % --EXOP: % --RNDR: renmatrix -%%BeginResource: uk.co.terryburton.bwipp hanxin 0.0 2016042100 299332 322644 +%%BeginResource: uk.co.terryburton.bwipp hanxin 0.0 2017040400 371193 376561 %%BeginData: 886 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -19973,8 +20402,8 @@ end % --EXAM: (01)95012345678903(3103)000123 % --EXOP: ccversion=b cccolumns=4 % --RNDR: renmatrix -%%BeginResource: uk.co.terryburton.bwipp gs1-cc 0.0 2016042100 201765 192209 -%%BeginData: 650 ASCII Lines +%%BeginResource: uk.co.terryburton.bwipp gs1-cc 0.0 2017040400 208546 207818 +%%BeginData: 656 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put @@ -20048,25 +20477,26 @@ begin } ifelse } loop } bind def - + % Parse out AIs - /ais [] def - /aival 2 dict def + /ais [] def + /vals [] def barcode dup length 1 sub 1 exch getinterval { % loop dup () eq {exit} if (\)) search pop exch pop exch (\() search { - exch pop exch 3 1 roll - } { + exch pop exch 3 1 roll + } { () 3 1 roll - } ifelse - [ ais aload pop counttomark 2 add index ] /ais exch def - aival 3 1 roll expand put + } ifelse + [ ais aload pop counttomark 2 add index ] /ais exch def + [ vals aload pop counttomark 1 add index expand ] /vals exch def + pop pop } loop pop - + % Method selection /isupper {dup 65 ge exch 90 le and} bind def % A-Z /isnum0 {dup 48 ge exch 57 le and} bind def % 0-9 @@ -20083,7 +20513,7 @@ begin % (90){0-3 digits not starting 0}{upper alpha}... ais length 1 ge { ais 0 get (90) eq { - /v aival (90) get def + /v vals 0 get def v length 1 ge { v 0 get isupper { 0 (11) exit @@ -20173,25 +20603,27 @@ begin method (10) eq { % TODO: fixme ais 0 get (11) eq ais 0 get (17) eq or { - aival ais 0 get get + vals 0 get dup 0 2 getinterval cvi 384 mul exch dup 2 2 getinterval cvi 1 sub 32 mul exch - 4 2 getinterval cvi add add + 4 2 getinterval cvi add add (0000000000000000) 16 string copy dup 3 -1 roll 2 16 string cvrs dup length 16 exch sub exch putinterval [ 1 0 4 -1 roll {48 sub} forall ais 0 get (11) eq {0} {1} ifelse ] /cdf exch def - /ais ais 1 ais length 1 sub getinterval def + /ais ais 1 ais length 1 sub getinterval def + /vals vals 1 vals length 1 sub getinterval def } { /cdf [ 1 0 1 1 ] def } ifelse ais length 0 ne { ais 0 get (10) eq { - /gpf [ aival (10) get {} forall ] def + /gpf [ vals 0 get {} forall ] def ais length 1 gt {/gpf [ gpf aload pop fnc1 ] def} if % TODO: check - /ais ais 1 ais length 1 sub getinterval def + /ais ais 1 ais length 1 sub getinterval def + /vals vals 1 vals length 1 sub getinterval def } { /gpf [fnc1] def % TODO: check } ifelse @@ -20204,7 +20636,7 @@ begin method (11) eq { /cdf [ 1 1 ] def - /ai90 aival (90) get def + /ai90 vals 0 get def npre 1 add ai90 length ne { ai90 npre 1 add ai90 length npre sub 1 sub getinterval } { @@ -20217,12 +20649,13 @@ begin nalpha nnums add ai90rem length ne {/mode (alphanumeric) def} if /cdf [ cdf aload pop - mode (alphanumeric) eq {0} if - mode (numeric) eq {1 0} if - mode (alpha) eq {1 1} if + mode (alphanumeric) eq {0} if + mode (numeric) eq {1 0} if + mode (alpha) eq {1 1} if ] def - /ais1 ais length 1 gt {ais 1 get} {-1} ifelse def - ais1 (21) eq ais1 (8004) eq or { + /ais1 ais length 1 gt {ais 1 get} {-1} ifelse def + /vals1 vals length 1 gt {vals 1 get} {-1} ifelse def + ais1 (21) eq ais1 (8004) eq or { /cdf [ cdf aload pop ais1 (21) eq {1 0} {1 1} ifelse ] def } { /cdf [ cdf aload pop 0 ] def @@ -20233,7 +20666,7 @@ begin /aval exch def } { pop /aval -1 def - } ifelse + } ifelse nval 31 lt aval -1 ne and { (00000) 5 string copy dup nval 2 5 string cvrs dup length 5 exch sub exch putinterval @@ -20242,7 +20675,7 @@ begin dup length 4 exch sub exch putinterval [ exch {48 sub} forall ] /abits exch def /cdf [ - cdf aload pop + cdf aload pop nbits aload pop abits aload pop ] def @@ -20268,25 +20701,27 @@ begin /out in length 6 mul array def /j 0 def 0 1 in length 1 sub { - in exch get encs exch get + in exch get encs exch get dup [ exch {48 sub} forall ] out exch j exch putinterval length j add /j exch def } for /cdf [ - cdf aload pop + cdf aload pop out 0 j getinterval aload pop ] def /gpf [] def ais length 1 gt mode (alpha) ne or {/mode (numeric) def} if } ifelse - /ais ais 1 ais length 1 sub getinterval def + /ais ais 1 ais length 1 sub getinterval def + /vals vals 1 vals length 1 sub getinterval def ais length 0 ne { ais1 (21) eq ais1 (8004) eq or { /gpf [ gpf aload pop - aival ais1 get {} forall + vals1 {} forall ] def - /ais ais 1 ais length 1 sub getinterval def + /ais ais 1 ais length 1 sub getinterval def + /vals vals 1 vals length 1 sub getinterval def ais length 0 ne {/gpf [gpf aload pop fnc1] def} if } if } if @@ -20320,7 +20755,7 @@ begin 0 1 ais length 1 sub { /i exch def /ai ais i get def - /val aival ai get def + /val vals i get def gpf length ai length add val length add array dup 0 gpf putinterval dup gpf length ai [ exch {} forall ] putinterval @@ -20635,7 +21070,7 @@ end % --EXAM: 2112345678900|(99)1234-abcd % --EXOP: includetext % --RNDR: renlinear renmatrix -%%BeginResource: uk.co.terryburton.bwipp ean13composite 0.0 2016042100 84127 84015 +%%BeginResource: uk.co.terryburton.bwipp ean13composite 0.0 2017040400 82022 81974 %%BeginData: 72 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -20719,7 +21154,7 @@ end % --EXAM: 02345673|(21)A12345678 % --EXOP: includetext % --RNDR: renlinear renmatrix -%%BeginResource: uk.co.terryburton.bwipp ean8composite 0.0 2016042100 84428 84317 +%%BeginResource: uk.co.terryburton.bwipp ean8composite 0.0 2017040400 82363 82316 %%BeginData: 75 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -20806,7 +21241,7 @@ end % --EXAM: 416000336108|(99)1234-abcd % --EXOP: includetext % --RNDR: renlinear renmatrix -%%BeginResource: uk.co.terryburton.bwipp upcacomposite 0.0 2016042100 84017 87498 +%%BeginResource: uk.co.terryburton.bwipp upcacomposite 0.0 2017040400 82104 82161 %%BeginData: 72 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 2 dict @@ -20890,7 +21325,7 @@ end % --EXAM: 00123457|(15)021231 % --EXOP: includetext % --RNDR: renlinear renmatrix -%%BeginResource: uk.co.terryburton.bwipp upcecomposite 0.0 2016042100 88387 84857 +%%BeginResource: uk.co.terryburton.bwipp upcecomposite 0.0 2017040400 83282 83120 %%BeginData: 87 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 2 dict @@ -20989,7 +21424,7 @@ end % --EXAM: (01)03612345678904|(11)990102 % --EXOP: % --RNDR: renlinear renmatrix -%%BeginResource: uk.co.terryburton.bwipp databaromnicomposite 0.0 2016042100 87388 83828 +%%BeginResource: uk.co.terryburton.bwipp databaromnicomposite 0.0 2017040400 82965 86277 %%BeginData: 100 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 2 dict @@ -21101,7 +21536,7 @@ end % --EXAM: (01)03412345678900|(17)010200 % --EXOP: % --RNDR: renlinear renmatrix -%%BeginResource: uk.co.terryburton.bwipp databarstackedcomposite 0.0 2016042100 89818 86093 +%%BeginResource: uk.co.terryburton.bwipp databarstackedcomposite 0.0 2017040400 88569 84684 %%BeginData: 96 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 2 dict @@ -21209,7 +21644,7 @@ end % --EXAM: (01)03612345678904|(11)990102 % --EXOP: % --RNDR: renlinear renmatrix -%%BeginResource: uk.co.terryburton.bwipp databarstackedomnicomposite 0.0 2016042100 89894 86165 +%%BeginResource: uk.co.terryburton.bwipp databarstackedomnicomposite 0.0 2017040400 88645 84756 %%BeginData: 96 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 2 dict @@ -21317,7 +21752,7 @@ end % --EXAM: (01)03612345678904|(11)990102 % --EXOP: % --RNDR: renlinear renmatrix -%%BeginResource: uk.co.terryburton.bwipp databartruncatedcomposite 0.0 2016042100 90784 87051 +%%BeginResource: uk.co.terryburton.bwipp databartruncatedcomposite 0.0 2017040400 89639 85738 %%BeginData: 100 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 2 dict @@ -21429,7 +21864,7 @@ end % --EXAM: (01)03512345678907|(21)abcdefghijklmnopqrstuv % --EXOP: % --RNDR: renlinear renmatrix -%%BeginResource: uk.co.terryburton.bwipp databarlimitedcomposite 0.0 2016042100 80661 80522 +%%BeginResource: uk.co.terryburton.bwipp databarlimitedcomposite 0.0 2017040400 79414 79211 %%BeginData: 79 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 2 dict @@ -21520,7 +21955,7 @@ end % --EXAM: (01)93712345678904(3103)001234|(91)1A2B3C4D5E % --EXOP: % --RNDR: renlinear renmatrix -%%BeginResource: uk.co.terryburton.bwipp databarexpandedcomposite 0.0 2016042100 83387 86828 +%%BeginResource: uk.co.terryburton.bwipp databarexpandedcomposite 0.0 2017040400 85836 82285 %%BeginData: 98 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 2 dict @@ -21630,7 +22065,7 @@ end % --EXAM: (01)00012345678905(10)ABCDEF|(21)12345678 % --EXOP: segments=4 % --RNDR: renmatrix renlinear -%%BeginResource: uk.co.terryburton.bwipp databarexpandedstackedcomposite 0.0 2016042100 86317 89413 +%%BeginResource: uk.co.terryburton.bwipp databarexpandedstackedcomposite 0.0 2017040400 88452 84444 %%BeginData: 95 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 2 dict @@ -21737,7 +22172,7 @@ end % --EXAM: (00)030123456789012340|(02)13012345678909(37)24(10)1234567ABCDEFG % --EXOP: ccversion=c % --RNDR: renlinear renmatrix -%%BeginResource: uk.co.terryburton.bwipp gs1-128composite 0.0 2016042100 90300 86481 +%%BeginResource: uk.co.terryburton.bwipp gs1-128composite 0.0 2017040400 85883 88824 %%BeginData: 100 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 2 dict @@ -21849,8 +22284,8 @@ end % --EXAM: (01)03453120000011(17)120508(10)ABCD1234(410)9501101020917 % --EXOP: % --RNDR: renmatrix -%%BeginResource: uk.co.terryburton.bwipp gs1datamatrix 0.0 2016042100 78432 74670 -%%BeginData: 134 ASCII Lines +%%BeginResource: uk.co.terryburton.bwipp gs1datamatrix 0.0 2017040400 79986 76213 +%%BeginData: 135 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put @@ -21894,25 +22329,26 @@ begin dup out exch j exch putinterval length j add /j exch def out 0 j getinterval exit - } ifelse + } ifelse } loop } bind def - + % Parse out AIs - /ais [] def - /aival 2 dict def + /ais [] def + /vals [] def barcode dup length 1 sub 1 exch getinterval { % loop dup () eq {exit} if (\)) search pop exch pop exch (\() search { - exch pop exch 3 1 roll - } { + exch pop exch 3 1 roll + } { () 3 1 roll } ifelse - [ ais aload pop counttomark 2 add index ] /ais exch def - aival 3 1 roll expand put + [ ais aload pop counttomark 2 add index ] /ais exch def + [ vals aload pop counttomark 1 add index expand ] /vals exch def + pop pop } loop pop @@ -21940,7 +22376,7 @@ begin 0 1 ais length 1 sub { /i exch def /ai ais i get def - /val aival ai get def + /val vals i get def dmtx length ai length add val length add array dup 0 dmtx putinterval dup dmtx length ai [ exch {} forall ] putinterval @@ -21995,8 +22431,8 @@ end % --EXAM: (01)03453120000011(17)120508(10)ABCD1234(410)9501101020917 % --EXOP: % --RNDR: renmatrix -%%BeginResource: uk.co.terryburton.bwipp gs1datamatrixrectangular 0.0 2016042100 78611 74838 -%%BeginData: 135 ASCII Lines +%%BeginResource: uk.co.terryburton.bwipp gs1datamatrixrectangular 0.0 2017040400 80189 79933 +%%BeginData: 136 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict dup /raiseerror dup /uk.co.terryburton.bwipp findresource put @@ -22040,25 +22476,26 @@ begin dup out exch j exch putinterval length j add /j exch def out 0 j getinterval exit - } ifelse + } ifelse } loop } bind def - + % Parse out AIs - /ais [] def - /aival 2 dict def + /ais [] def + /vals [] def barcode dup length 1 sub 1 exch getinterval { % loop dup () eq {exit} if (\)) search pop exch pop exch (\() search { - exch pop exch 3 1 roll - } { + exch pop exch 3 1 roll + } { () 3 1 roll } ifelse - [ ais aload pop counttomark 2 add index ] /ais exch def - aival 3 1 roll expand put + [ ais aload pop counttomark 2 add index ] /ais exch def + [ vals aload pop counttomark 1 add index expand ] /vals exch def + pop pop } loop pop @@ -22086,7 +22523,7 @@ begin 0 1 ais length 1 sub { /i exch def /ai ais i get def - /val aival ai get def + /val vals i get def dmtx length ai length add val length add array dup 0 dmtx putinterval dup dmtx length ai [ exch {} forall ] putinterval @@ -22142,8 +22579,8 @@ end % --EXAM: (01)03453120000011(8200)http://www.abc.net(10)ABCD1234(410)9501101020917 % --EXOP: % --RNDR: renmatrix -%%BeginResource: uk.co.terryburton.bwipp gs1qrcode 0.0 2016042100 78192 78026 -%%BeginData: 133 ASCII Lines +%%BeginResource: uk.co.terryburton.bwipp gs1qrcode 0.0 2017040400 76420 79603 +%%BeginData: 134 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict dup /renmatrix dup /uk.co.terryburton.bwipp findresource put @@ -22186,25 +22623,26 @@ begin dup out exch j exch putinterval length j add /j exch def out 0 j getinterval exit - } ifelse + } ifelse } loop } bind def - + % Parse out AIs - /ais [] def - /aival 2 dict def + /ais [] def + /vals [] def barcode dup length 1 sub 1 exch getinterval { % loop dup () eq {exit} if (\)) search pop exch pop exch (\() search { - exch pop exch 3 1 roll - } { + exch pop exch 3 1 roll + } { () 3 1 roll } ifelse - [ ais aload pop counttomark 2 add index ] /ais exch def - aival 3 1 roll expand put + [ ais aload pop counttomark 2 add index ] /ais exch def + [ vals aload pop counttomark 1 add index expand ] /vals exch def + pop pop } loop pop @@ -22226,13 +22664,13 @@ begin 10 2 string cvrs dup aifixed 3 1 roll put } forall - % Create the qrcode data + % Create the qrcode data /fnc1 -1 def /qrc [ fnc1 ] def 0 1 ais length 1 sub { /i exch def /ai ais i get def - /val aival ai get def + /val vals i get def qrc length ai length add val length add array dup 0 qrc putinterval dup qrc length ai [ exch {} forall ] putinterval @@ -22287,7 +22725,7 @@ end % --EXAM: A123BJC5D6E71 % --EXOP: includetext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp hibccode39 0.0 2016042100 63169 62924 +%%BeginResource: uk.co.terryburton.bwipp hibccode39 0.0 2017040400 68512 68281 %%BeginData: 92 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -22391,7 +22829,7 @@ end % --EXAM: A123BJC5D6E71 % --EXOP: includetext % --RNDR: renlinear -%%BeginResource: uk.co.terryburton.bwipp hibccode128 0.0 2016042100 67484 66909 +%%BeginResource: uk.co.terryburton.bwipp hibccode128 0.0 2017040400 68415 68036 %%BeginData: 91 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -22494,7 +22932,7 @@ end % --EXAM: A123BJC5D6E71 % --EXOP: % --RNDR: renmatrix -%%BeginResource: uk.co.terryburton.bwipp hibcdatamatrix 0.0 2016042100 65207 64879 +%%BeginResource: uk.co.terryburton.bwipp hibcdatamatrix 0.0 2017040400 65202 64798 %%BeginData: 74 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -22580,7 +23018,7 @@ end % --EXAM: A123BJC5D6E71 % --EXOP: % --RNDR: renmatrix -%%BeginResource: uk.co.terryburton.bwipp hibcdatamatrixrectangular 0.0 2016042100 65520 65071 +%%BeginResource: uk.co.terryburton.bwipp hibcdatamatrixrectangular 0.0 2017040400 65451 65014 %%BeginData: 75 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -22667,7 +23105,7 @@ end % --EXAM: A123BJC5D6E71 % --EXOP: % --RNDR: renmatrix -%%BeginResource: uk.co.terryburton.bwipp hibcpdf417 0.0 2016042100 65468 65072 +%%BeginResource: uk.co.terryburton.bwipp hibcpdf417 0.0 2017040400 65591 65215 %%BeginData: 78 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -22757,7 +23195,7 @@ end % --EXAM: A123BJC5D6E71 % --EXOP: % --RNDR: renmatrix -%%BeginResource: uk.co.terryburton.bwipp hibcmicropdf417 0.0 2016042100 65606 65195 +%%BeginResource: uk.co.terryburton.bwipp hibcmicropdf417 0.0 2017040400 65641 65250 %%BeginData: 78 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -22847,7 +23285,7 @@ end % --EXAM: A123BJC5D6E71 % --EXOP: % --RNDR: renmatrix -%%BeginResource: uk.co.terryburton.bwipp hibcqrcode 0.0 2016042100 65071 68091 +%%BeginResource: uk.co.terryburton.bwipp hibcqrcode 0.0 2017040400 65146 64770 %%BeginData: 74 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -22933,7 +23371,7 @@ end % --EXAM: A123BJC5D6E71 % --EXOP: % --RNDR: renmatrix -%%BeginResource: uk.co.terryburton.bwipp hibccodablockf 0.0 2016042100 60823 64313 +%%BeginResource: uk.co.terryburton.bwipp hibccodablockf 0.0 2017040400 65182 64798 %%BeginData: 74 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -23019,7 +23457,7 @@ end % --EXAM: A123BJC5D6E71 % --EXOP: % --RNDR: renmatrix -%%BeginResource: uk.co.terryburton.bwipp hibcazteccode 0.0 2016042100 65179 68272 +%%BeginResource: uk.co.terryburton.bwipp hibcazteccode 0.0 2017040400 68614 64895 %%BeginData: 74 ASCII Lines /setpacking where {pop currentpacking true setpacking} if 1 dict |