diff options
author | Karl Berry <karl@freefriends.org> | 2012-07-11 23:31:41 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-07-11 23:31:41 +0000 |
commit | 04c5c867bd74fc26d0605dbe7aea8fc70d8c6066 (patch) | |
tree | 1013bc3edb82def6a2278158c9db567b3d3e0698 | |
parent | d41b09fae4e020f0ff6108838e6175646f3d2b9e (diff) |
pst-barcode 2012-06-26 (5jul12)
git-svn-id: svn://tug.org/texlive/trunk@27004 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-barcode/Changes | 28 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-barcode/pst-barcode-doc.bib | 40 | ||||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-barcode/pst-barcode-doc.pdf | bin | 229501 -> 239471 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/generic/pst-barcode/pst-barcode-doc.tex | 102 | ||||
-rw-r--r-- | Master/texmf-dist/dvips/pst-barcode/pst-barcode.pro | 740 | ||||
-rw-r--r-- | Master/texmf-dist/source/generic/pst-barcode/Makefile | 1 | ||||
-rw-r--r-- | Master/texmf-dist/tex/generic/pst-barcode/pst-barcode.tex | 4 |
7 files changed, 645 insertions, 270 deletions
diff --git a/Master/texmf-dist/doc/generic/pst-barcode/Changes b/Master/texmf-dist/doc/generic/pst-barcode/Changes index d49c293519b..5deaf6b3c0a 100644 --- a/Master/texmf-dist/doc/generic/pst-barcode/Changes +++ b/Master/texmf-dist/doc/generic/pst-barcode/Changes @@ -1,4 +1,5 @@ ----- pst-barcode.tex +0.09 2012-06-25 - using another code for loading the ps code 0.08 2011-03-10 - take care of the function interface of the pro file 0.07 2009-08-12 - take care of the function interface of the pro file 0.04 2006-07-23 - adding support for the ISBN-13 code @@ -14,7 +15,32 @@ ----- pst-barcode.pro -2011-03-12 - The error correction code for Maxicode symbols was improved. +2012-06-26 - The QR Code encoder was modified so that Micro QR Code + symbols do not require the use of raw mode. + - Support for the alphanumeric, numeric, and kanji encodings + was added to the QR Code encoder. + - The PZN symbology was extended with support + for PZN8. + - Support for the GS1 DataMatrix symbology was added. + - A bug in double digit ASCII encodation of the Data Matrix + symbology was fixed. + - The EDIFACT, C40, TEXT, and X12 encodation schemes were + removed from the Data Matrix symbology, as + these were buggy. + - Support for FNC1 character as added to the Data Matrix symbology. +2012-06-25 - The QR Code encoder was modified to select an + optimal encoder based on the data. + - A bug in the symbol size selection for + QR Code was fixed. + - The QR Code encoder was optimised by + allowing the terminator pattern to be trimmed. + - Support for the alphanumeric, numeric and + kanji encodings was added to the qrcode encoder. + - The PZN symbology was extended with support for PZN8. + - The 1.5 scale factor was removed from the + DataMatrix encoder. + +2011-03-10 - The error correction code for Maxicode symbols was improved. - Codablock F was fixed for short data inputs. - Support for the Codablock F symbology was added. - Support for the HIBC Codablock F symbology was added. diff --git a/Master/texmf-dist/doc/generic/pst-barcode/pst-barcode-doc.bib b/Master/texmf-dist/doc/generic/pst-barcode/pst-barcode-doc.bib index f54f7347dfb..551c090f5e8 100644 --- a/Master/texmf-dist/doc/generic/pst-barcode/pst-barcode-doc.bib +++ b/Master/texmf-dist/doc/generic/pst-barcode/pst-barcode-doc.bib @@ -171,11 +171,37 @@ year = 2004 } -@book{voss06, - Title = {Mathematiksatz in \LaTeX{}}, - Author = {Herbert Vo\ss}, - Publisher = {Lehmanns Media/DANTE}, - Edition= {first}, - Address= {Berlin/Heidelberg}, - Year= {2009}, +@Book{presentations, + author = {Herbert Vo\ss}, + title = {Presentations with \LaTeX}, + edition = {1.}, + publisher = {DANTE -- Lehmanns Media}, + year = {2012}, + address = {Heidelberg/Berlin} +} + +@Book{PSTricksE, + author = {Herbert Vo\ss}, + title = {\texttt{PSTricks} -- {G}raphics for \LaTeX}, + edition = {1.}, + publisher = {UIT}, + year = {2011}, + address = {Cambridge/UK} +} + +@Book{LaTeXRef, + author = {Herbert Vo\ss}, + title = {\LaTeX\ Referenz}, + edition = {2.}, + publisher = {DANTE -- lehmanns media}, + year = {2010}, + address = {Heidelberg/Hamburg} +} +@Book{LaTeXRefE, + author = {Herbert Vo\ss}, + title = {\LaTeX\ Quick Reference}, + edition = {1.}, + publisher = {UIT}, + year = {2011}, + address = {Cambridge/UK} } diff --git a/Master/texmf-dist/doc/generic/pst-barcode/pst-barcode-doc.pdf b/Master/texmf-dist/doc/generic/pst-barcode/pst-barcode-doc.pdf Binary files differindex ac10b110f50..3825bf8d445 100644 --- a/Master/texmf-dist/doc/generic/pst-barcode/pst-barcode-doc.pdf +++ b/Master/texmf-dist/doc/generic/pst-barcode/pst-barcode-doc.pdf diff --git a/Master/texmf-dist/doc/generic/pst-barcode/pst-barcode-doc.tex b/Master/texmf-dist/doc/generic/pst-barcode/pst-barcode-doc.tex index 28b2a05fce7..2fe0037cea3 100644 --- a/Master/texmf-dist/doc/generic/pst-barcode/pst-barcode-doc.tex +++ b/Master/texmf-dist/doc/generic/pst-barcode/pst-barcode-doc.tex @@ -720,8 +720,8 @@ It is used for the german post company DHL. \item[Data] Variable number characters \end{description} -\begin{LTXexample}[pos=l,width=1in,wide] -\begin{pspicture}(1in,1in) +\begin{LTXexample}[pos=l,width=1.6in,wide] +\begin{pspicture}(1.5in,1.5in) \psbarcode{Herbert Voss ^142^164^186}{rows=48 columns=48 parse}{datamatrix} \end{pspicture} \end{LTXexample} @@ -776,22 +776,6 @@ The modes: \end{LTXexample} -\subsection{QR Code} -A QR Code (Quick Response) is a 2 dimensional matrix code created by Japanese -corporation Denso-Wave in 1994 (\url{http://de.wikipedia.org/wiki/QR_Code}). - - -\begin{description} -\item[Characters] \verb!0123456789! -\item[Data] Variable number characters -\end{description} - -\begin{LTXexample}[pos=l,width=1in,wide] -\begin{pspicture}(1in,1in) -\psbarcode{http://www.dante.de}{}{qrcode} -\end{pspicture} -\end{LTXexample} - \subsection{Aztec Code} Aztec Code is a 2 dimensional matrix style bar code symbology. @@ -833,10 +817,9 @@ Aztec Code was invented by Andrew Longacre (USA) in 1995 \end{LTXexample} -\subsection{qrcode} -%Aztec Code is a 2 dimensional matrix style bar code symbology. -%Aztec Code was invented by Andrew Longacre (USA) in 1995 -%(\url{http://de.wikipedia.org/wiki/Aztec_Code}). +\subsection{QR Code} +A QR Code (Quick Response) is a 2 dimensional matrix code created by Japanese +corporation Denso-Wave in 1994 (\url{http://de.wikipedia.org/wiki/QR_Code}). \begin{description} @@ -844,13 +827,86 @@ Aztec Code was invented by Andrew Longacre (USA) in 1995 \item[Data] Variable number characters \end{description} -\begin{LTXexample}[width=1.5in,wide] +The data field can contain any extended ASCII data. +When the parse option is specified, any instances of \verb|^NNN| in the data field are +replaced with their equivalent ASCII value, useful for specifying unprintable characters. + + The eclevel option is used to specify the error correction level: +\begin{description} +\item[eclevel=L] - Low (default for micro format symbols) +\item[eclevel=M] - Medium (default for full format symbols) +\item[eclevel=Q] - Quality +\item[eclevel=H] - High +\end{description} + +The eclevel will be opportunistically raised when this does not result in an increased symbol size. +The encoding option is used to specify a desired encoding for the input data which can sometimes result in a more optimal symbol size: + +\begin{description} +\item[encoding=alphanumeric] - Alphanumeric data +\item[encoding=numeric] - Numeric data +\item[encoding=byte] - Byte based encoding +\item[encoding=kanji] - Kanji characters based on Shift JIS +\item[encoding=raw] - Equivalent to the raw option + If left unspecified the optimal available encoding will be chosen for the given data in + the following order of preference: numeric, alphanumeric, kanji, byte. + The version option is used to specify the size of the symbol, 1 to 40 for full + format symbols or \verb|version=M1|, \verb|version=M2|, \verb|version=M3| or \verb|version=M4| + for micro format symbols. + If unspecified, the encoder will select the version of the symbol that is the minimum + size to represent the given data at the selected error correction level. + The format option is used to select between format=full and format=micro symbol + types. By default, full format symbols will be generated. + The raw option denotes that the data field is providing the input as a pre-encoded + bitstream (excluding the terminator bits) suitable for direct low-level encoding. +\end{description} + + +\begin{LTXexample}[pos=l,width=1in] +\begin{pspicture}(1in,1in) +\psbarcode{http://www.dante.de}{}{qrcode} +\end{pspicture} +\end{LTXexample} + +\begin{LTXexample}[width=1.5in] \begin{pspicture}(1in,1in) \psbarcode{http://www.dante.de}{eclevel=M}{qrcode} \end{pspicture} \end{LTXexample} +\begin{LTXexample}[width=1.5in] +\begin{pspicture}(1in,1in) +\psbarcode{QR ^067ode}{parse}{qrcode} +\end{pspicture} +\end{LTXexample} + +\begin{LTXexample}[width=1.5in] +\begin{pspicture}(2in,2in) +\psbarcode{QR CODE 1234}{version=10 eclevel=Q}{qrcode} +\end{pspicture} +\end{LTXexample} + +\begin{LTXexample}[width=1.5in] +\begin{pspicture}(0.5in,0.5in) +\psbarcode{01234567}{format=micro}{qrcode} +\end{pspicture} +\end{LTXexample} + +\begin{LTXexample}[width=1.5in] +\begin{pspicture}(1in,1in) +\psbarcode{000100000010000000001100010101100110000110000}{raw}{qrcode} +\end{pspicture} +\end{LTXexample} + +\begin{LTXexample}[width=1in,wide] +\begin{pspicture}(0.5in,0.5in) +\psbarcode{0010000000000110001010110011010100110111000010100111010100101}{format=micro raw}{qrcode} +\end{pspicture} +\end{LTXexample} + + + \section{Code Commentary} This commentary assumes familiarity with the PostScript language\footnote{The PostScript Language Tutorial and Cookbook diff --git a/Master/texmf-dist/dvips/pst-barcode/pst-barcode.pro b/Master/texmf-dist/dvips/pst-barcode/pst-barcode.pro index 57ac6956c5b..453d96fbc1b 100644 --- a/Master/texmf-dist/dvips/pst-barcode/pst-barcode.pro +++ b/Master/texmf-dist/dvips/pst-barcode/pst-barcode.pro @@ -3,10 +3,10 @@ %%DocumentPaperSizes: a4 %%EndComments -% Barcode Writer in Pure PostScript - Version 2011-03-09 +% Barcode Writer in Pure PostScript - Version 2012-06-26 % http://www.terryburton.co.uk/barcodewriter/ % -% Copyright (c) 2004-2011 Terry Burton +% Copyright (c) 2004-2012 Terry Burton % % Permission is hereby granted, free of charge, to any % person obtaining a copy of this software and associated @@ -3011,6 +3011,7 @@ begin /textyoffset -7 def /textxoffset 0 def /height 1 def + /pzn8 false def % Parse the input options options type /stringtype eq { @@ -3028,28 +3029,26 @@ begin /textyoffset textyoffset cvr def /textxoffset textxoffset cvr def /height height cvr def - - /text 13 string def - text 0 barcode 0 6 getinterval putinterval + + /msg pzn8 {9} {8} ifelse string def + /msglen msg length def + msg 0 45 put + msg 1 barcode 0 msglen 2 sub getinterval putinterval % calculate check digit - text 6 0 - 0 1 5 { - dup text exch get 48 sub exch 2 add mul add - } for - 11 mod 48 add put - - /barcode 8 string def - barcode 1 text 0 7 getinterval putinterval - barcode 0 45 put + 0 + 1 1 msglen 2 sub {dup msg exch get 48 sub exch pzn8 not {1 add} if mul add} for + 11 mod 48 add + msg exch msglen 1 sub exch put % Get the result of encoding with code39 options (dontdraw) true put - /args barcode options //code39 exec def + /args msg options //code39 exec def % format HRI - text 6 text 0 7 getinterval putinterval + /text msglen 5 add string def text 0 (PZN - ) putinterval + text 6 msg 1 msglen 1 sub getinterval putinterval args (txt) [ [text textxoffset textyoffset textfont textsize] ] put args (textxalign) (center) put @@ -8335,7 +8334,7 @@ end % --BEGIN ENCODER codablockf-- % --DESC: Codablock F % --EXAM: CODABLOCK F 34567890123456789010040digit -% --EXOP: cols=8 +% --EXOP: columns=8 % --RNDR: renmatrix /setpacking where {pop currentpacking true setpacking} if 1 dict @@ -8350,7 +8349,7 @@ begin /dontdraw false def /rows -1 def - /cols 8 def + /columns 8 def /rowheight 10 def /sepheight 1 def /encoding (auto) def @@ -8369,12 +8368,12 @@ begin options {def} forall /rows rows cvi def - /cols cols cvi def + /columns columns cvi def /rowheight rowheight cvi def /sepheight sepheight cvi def - cols 4 ge cols 62 le and - rows 2 ge rows 44 le and rows -1 eq or and {/c cols def} if + columns 4 ge columns 62 le and + rows 2 ge rows 44 le and rows -1 eq or and {/c columns def} if % Parse ordinals of the form ^NNN to ASCII parse { @@ -11028,6 +11027,17 @@ begin /dontdraw false 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 + barcode (fima) eq { /sbs [2.25 2.25 2.25 11.25 2.25 11.25 2.25 2.25 2.25] def /bhs [.625 .625 .625 .625 .625] def @@ -12192,9 +12202,10 @@ begin /dontdraw false def /columns 0 def /rows 0 def - /encoding (byte) def + /encoding (ascii) def /raw false def /parse false def + /parsefnc false def % Parse the input options options type /stringtype eq { @@ -12248,29 +12259,44 @@ begin /cws cws 0 j getinterval def } if - encoding (byte) eq { - barlen 250 lt { - /cws [231 barlen barcode {} forall] def - } { - /cws [231 barlen 250 idiv 249 add barlen 250 mod barcode {} forall] def - } ifelse - 1 1 cws length 1 sub { - /i exch def - i 1 add 149 mul 255 mod 1 add cws i get add - dup 256 ge {256 sub} if - cws exch i exch put - } for - } if + % Special function characters + /fn1 -1 def encoding (ascii) eq { - /cws barlen 2 mul array def - /i 0 def /j 0 def - { % loop + /fncvals << + (FNC1) fn1 + >> def + /msg barlen array def + /i 0 def /j 0 def { i barlen eq {exit} if /char barcode i get def - char 48 ge char 57 le and i barlen 1 sub lt and { - barcode i 1 add get dup 48 ge exch 57 le and { % Digit pair - cws j barcode i 2 getinterval cvi 130 add put + parsefnc char 94 eq and i barlen 4 sub lt and { + barcode i 1 add get 94 ne { + /char fncvals barcode i 1 add 4 getinterval get def + /i i 4 add def + } { + /i i 1 add def + } ifelse + } if + msg j char put + /i i 1 add def + /j j 1 add def + } loop + /msg msg 0 j getinterval def + /msglen msg length def + + /cws msglen 2 mul array def + /i 0 def /j 0 def + { % loop + i msglen eq {exit} if + /char msg i get def + char fn1 eq { % FNC1 + cws j 232 put + /i i 1 add def + /j j 1 add def + } { char 48 ge char 57 le and i msglen 1 sub lt and { + msg i 1 add get dup 48 ge exch 57 le and { % Digit pair + cws j msg i get 48 sub 10 mul msg i 1 add get 48 sub add 130 add put /i i 2 add def /j j 1 add def } { % Singular digit @@ -12287,146 +12313,11 @@ begin cws j 1 add char 127 sub put /i i 1 add def /j j 2 add def - } ifelse } ifelse + } ifelse } ifelse } ifelse } loop /cws cws 0 j getinterval def } if - encoding (edifact) eq { - /cws 1558 array def - /i 0 def /j 1 def /k 0 def - cws 0 240 put - { % loop - i barlen gt {exit} if - /k 0 def /v 0 def - { % loop until triplet is full or beyond end of data - k 4 eq i barlen gt or {exit} if - /cval (unset) def - i barlen lt { - /char barcode i get def - char 32 ge char 94 le and { - /cval char 63 and def - } if - } { % Unlatch at end of data - /cval 31 def - } ifelse - /v v cval 3 k sub 6 mul bitshift or def - /k k 1 add def - /i i 1 add def - } loop - cws j [ v -16 bitshift v -8 bitshift 255 and v 255 and ] putinterval - /j j 3 add def - } loop - /cws cws 0 j getinterval def - } if - - encoding (c40) eq encoding (text) eq or encoding (x12) eq or { - - /s1 0 def /s2 1 def /s3 2 def /us 30 def - - encoding (c40) eq { - /latch 230 def - /charmap [ - 0 1 31 { [ exch s1 exch ] } for % 0-31 - [ 3 ] % 32 - 0 1 14 { [ exch s2 exch ] } for % 33-47 - 4 1 13 { [ exch ] } for % 48-57 - 15 1 21 { [ exch s2 exch ] } for % 58-64 - 14 1 39 { [ exch ] } for % 65-90 - 22 1 26 { [ exch s2 exch ] } for % 91-95 - [ s3 0 ] % 96 - 1 1 26 { [ exch s3 exch ] } for % 97-122 - 27 1 31 { [ exch s3 exch ] } for % 123-127 - 0 1 31 { [ s2 us 4 -1 roll s1 exch ] } for % 128-159 - [ s2 us 3 ] % 160 - 0 1 14 { [ s2 us 4 -1 roll s2 exch ] } for % 161-175 - 4 1 13 { [ s2 us 4 -1 roll ] } for % 176-185 - 15 1 21 { [ s2 us 4 -1 roll s2 exch ] } for % 186-192 - 14 1 39 { [ s2 us 4 -1 roll ] } for % 193-218 - 22 1 26 { [ s2 us 4 -1 roll s2 exch ] } for % 219-223 - [ s2 us s3 0 ] % 224 - 1 1 26 { [ s2 us 4 -1 roll s3 exch ] } for % 225-250 - 27 1 31 { [ s2 us 4 -1 roll s3 exch ] } for % 251-255 - ] def - } if - - encoding (text) eq { - /latch 239 def - /charmap [ - 0 1 31 { [ exch s1 exch ] } for % 0-31 - [ 3 ] % 32 - 0 1 14 { [ exch s2 exch ] } for % 33-47 - 4 1 13 { [ exch ] } for % 48-57 - 15 1 21 { [ exch s2 exch ] } for % 58-64 - 1 1 26 { [ exch s3 exch ] } for % 65-90 - 22 1 26 { [ exch s2 exch ] } for % 91-95 - [ s3 0 ] % 96 - 14 1 39 { [ exch ] } for % 97-122 - 27 1 31 { [ exch s3 exch ] } for % 123-127 - 0 1 31 { [ s2 us 4 -1 roll s1 exch ] } for % 128-159 - [ s2 us 3 ] % 160 - 0 1 14 { [ s2 us 4 -1 roll s2 exch ] } for % 161-175 - 4 1 13 { [ s2 us 4 -1 roll ] } for % 176-185 - 15 1 21 { [ s2 us 4 -1 roll s2 exch ] } for % 186-192 - 1 1 26 { [ s2 us 4 -1 roll s3 exch ] } for % 193-218 - 22 1 26 { [ s2 us 4 -1 roll s2 exch ] } for % 219-223 - [ s2 us s3 0 ] % 224 - 14 1 39 { [ s2 us 4 -1 roll ] } for % 225-250 - 27 1 31 { [ s2 us 4 -1 roll s3 exch ] } for % 251-255 - ] def - } if - - encoding (x12) eq { - /latch 238 def - /charmap [ - 13 { [ () ] } repeat % 0-12 - [ 0 ] % 13 - 18 { [ () ] } repeat % 14-31 - [ 3 ] % 32 - 9 { [ () ] } repeat % 33-41 - [ 1 ] % 42 - 5 { [ () ] } repeat % 43-47 - 4 1 13 { [ exch ] } for % 48-57 - 4 { [ () ] } repeat % 58-61 - [ 2 ] % 62 - 2 { [ () ] } repeat % 63-64 - 14 1 39 { [ exch ] } for % 65-90 - 165 { [ () ] } repeat % 91-255 - ] def - } if - - % Derive the encoded character stream - /encstr barlen 4 mul array def - /j 0 def - 0 1 barlen 1 sub { - barcode exch get charmap exch get - dup encstr exch j exch putinterval - length j add /j exch def - } for - /encstr encstr 0 j getinterval def - /enclen j def - - % Compress triples into doubles - /cws 1558 array def - /i 0 def /j 1 def /k 0 def - cws 0 latch put - { % loop - i enclen ge {exit} if - /k 0 def /v 1 def - { % loop until triple is full or end of data - k 3 eq i enclen ge or {exit} if - /v v encstr i get 40 2 k sub exp cvi mul add def - /k k 1 add def - /i i 1 add def - } loop - cws j [ v -8 bitshift v 255 and ] putinterval - /j j 2 add def - } loop - cws j 254 put - /cws cws 0 j 1 add getinterval def - - } if - % Basic metrics for the each symbol % rows cols regh regv rscw rsbl /metrics [ @@ -12710,8 +12601,8 @@ begin /pixs pixs /pixx cols /pixy rows - /height rows 72 div 1.5 mul - /width cols 72 div 1.5 mul + /height rows 2 mul 72 div + /width cols 2 mul 72 div /opt options >> @@ -12745,6 +12636,7 @@ begin /format (full) def % full or micro /version (unset) def /eclevel (unset) def % L, M, Q or H + /encoding (unset) def /raw false def /parse false def @@ -12780,75 +12672,293 @@ begin } loop } if - % Force raw mode for micro format symbols - format (micro) eq {/raw true def} if + /barlen barcode length def - % Default to error correction level M - eclevel (unset) eq {/eclevel (M) def} if + % Default error correction level + eclevel (unset) eq {/eclevel format (full) eq {(M)} {(L)} ifelse def} if % Convert from input into message bitstream - raw { + raw {/encoding (raw) def} if + encoding (raw) eq { /msgbits barcode def - } { % Simple autoencoder from input to bitstream using byte mode only for full format symbols + } { - /barlen barcode length def - eclevel (unset) eq {/eclevel (M) def} if + % Symbol capacities + /fullcaps << + /numeric << + /L [ 41 77 127 187 255 322 370 461 552 652 % 1-L - 10-L + 772 883 1022 1101 1250 1408 1548 1725 1903 2061 % 11-L - 20-L + 2232 2409 2620 2812 3057 3283 3517 3669 3909 4158 % 21-L - 30-L + 4417 4686 4965 5253 5529 5836 6153 6479 6743 7089 ] % 31-L - 40-L + /M [ 34 63 101 149 202 255 293 365 432 513 % 1-M - 10-M + 604 691 796 871 991 1082 1212 1346 1500 1600 % 11-M - 20-M + 1708 1872 2059 2188 2395 2544 2701 2857 3035 3289 % 21-M - 30-M + 3486 3693 3909 4134 4343 4588 4775 5039 5313 5596 ] % 31-M - 40-M + /Q [ 27 48 77 111 144 178 207 259 312 364 % 1-Q - 10-Q + 427 489 580 621 703 775 876 948 1063 1159 % 11-Q - 20-Q + 1224 1358 1468 1588 1718 1804 1933 2085 2181 2358 % 21-Q - 30-Q + 2473 2670 2805 2949 3081 3244 3417 3599 3791 3993 ] % 31-Q - 40-Q + /H [ 17 34 58 82 106 139 154 202 235 288 % 1-H - 10-H + 331 374 427 468 530 602 674 746 813 919 % 11-H - 20-H + 969 1056 1108 1228 1286 1425 1501 1581 1677 1782 % 21-H - 30-H + 1897 2022 2157 2301 2361 2524 2625 2735 2927 3057 ] % 31-H - 40-H + >> + /alphanumeric << + /L [ 25 47 77 114 154 195 224 279 335 395 % 1-L - 10-L + 468 535 619 667 758 854 938 1046 1153 1249 % 11-L - 20-L + 1352 1460 1588 1704 1853 1990 2132 2223 2369 2520 % 21-L - 30-L + 2677 2840 3009 3183 3351 3537 3729 3927 4087 4296 ] % 31-L - 40-L + /M [ 20 38 61 90 122 154 178 221 262 311 % 1-M - 10-M + 366 419 483 528 600 656 734 816 909 970 % 11-M - 20-M + 1035 1134 1248 1326 1451 1542 1637 1732 1839 1994 % 21-M - 30-M + 2113 2238 2369 2506 2632 2780 2894 3054 3220 3391 ] % 31-M - 40-M + /Q [ 16 29 47 67 87 108 125 157 189 221 % 1-Q - 10-Q + 259 296 352 376 426 470 531 574 644 702 % 11-Q - 20-Q + 742 823 890 963 1041 1094 1172 1263 1322 1429 % 21-Q - 30-Q + 1499 1618 1700 1787 1867 1966 2071 2181 2298 2420 ] % 31-Q - 40-Q + /H [ 10 20 35 50 64 84 93 122 143 174 % 1-H - 10-H + 200 227 259 283 321 365 408 452 493 557 % 11-H - 20-H + 587 640 672 744 779 864 910 958 1016 1080 % 21-H - 30-H + 1150 1226 1307 1394 1431 1530 1591 1658 1774 1852 ] % 31-H - 40-H + >> + /byte << + /L [ 17 32 53 78 106 134 154 192 230 271 % 1-L - 10-L + 321 367 425 458 520 586 644 718 792 858 % 11-L - 20-L + 929 1003 1091 1171 1273 1367 1465 1528 1628 1732 % 21-L - 30-L + 1840 1952 2068 2188 2303 2431 2563 2699 2809 2953 ] % 31-L - 40-L + /M [ 14 26 42 62 84 106 122 152 180 213 % 1-M - 10-M + 251 287 331 362 412 450 504 560 624 666 % 11-M - 20-M + 711 779 857 911 997 1059 1125 1190 1264 1370 % 21-M - 30-M + 1452 1538 1628 1722 1809 1911 1989 2099 2213 2331 ] % 31-M - 40-M + /Q [ 11 20 32 46 60 74 86 108 130 151 % 1-Q - 10-Q + 177 203 241 258 292 322 364 394 442 482 % 11-Q - 20-Q + 509 565 611 661 715 751 805 868 908 982 % 21-Q - 30-Q + 1030 1112 1168 1228 1283 1351 1423 1499 1579 1663 ] % 31-Q - 40-Q + /H [ 7 14 24 34 44 58 64 84 98 119 % 1-H - 10-H + 137 155 177 194 220 250 280 310 338 382 % 11-H - 20-H + 403 439 461 511 535 593 625 658 698 742 % 21-H - 30-H + 790 842 898 958 983 1051 1093 1139 1219 1273 ] % 31-H - 40-H + >> + /kanji << + /L [ 10 20 32 48 65 82 95 118 141 167 % 1-L - 10-L + 198 226 262 282 320 361 397 442 488 528 % 11-L - 20-L + 572 618 672 721 784 842 902 940 1002 1066 % 21-L - 30-L + 1132 1201 1273 1347 1417 1496 1577 1661 1729 1817 ] % 31-L - 40-L + /M [ 8 16 26 38 52 65 75 93 111 131 % 1-M - 10-M + 155 177 204 223 254 277 310 345 384 410 % 11-M - 20-M + 438 480 528 561 614 652 692 732 778 843 % 21-M - 30-M + 894 947 1002 1060 1113 1176 1224 1292 1362 1435 ] % 31-M - 40-M + /Q [ 7 12 20 28 37 45 53 66 80 93 % 1-Q - 10-Q + 109 125 149 159 180 198 224 243 272 297 % 11-Q - 20-Q + 314 348 376 407 440 462 496 534 559 604 % 21-Q - 30-Q + 634 684 719 756 790 832 876 923 972 1024 ] % 31-Q - 40-Q + /H [ 4 8 15 21 27 36 39 52 60 74 % 1-H - 10-H + 85 96 109 120 136 154 173 191 208 235 % 11-H - 20-H + 248 270 284 315 330 365 385 405 430 457 % 21-H - 30-H + 486 518 553 590 605 647 673 701 750 784 ] % 31-H - 40-H + >> + >> def + + % M1 M2 M3 M4 M1 M2 M3 M4 M1 M2 M3 M4 M1 M2 M3 M4 + /microcaps << + /numeric << + /L [ 5 10 23 35 ] /M [ -1 8 18 30 ] /Q [ -1 -1 -1 21 ] /H [ -1 -1 -1 -1 ] + >> + /alphanumeric << + /L [ -1 6 14 21 ] /M [ -1 5 11 18 ] /Q [ -1 -1 -1 13 ] /H [ -1 -1 -1 -1 ] + >> + /byte << + /L [ -1 -1 9 15 ] /M [ -1 -1 7 13 ] /Q [ -1 -1 -1 9 ] /H [ -1 -1 -1 -1 ] + >> + /kanji << + /L [ -1 -1 6 9 ] /M [ -1 -1 4 8 ] /Q [ -1 -1 -1 5 ] /H [ -1 -1 -1 -1 ] + >> + >> def + + /encvals << + /numeric 0 + /alphanumeric 1 + /byte 2 + /kanji 3 + >> def + + /encs << + /numeric /encnumeric + /alphanumeric /encalphanumeric + /byte /encbyte + /kanji /enckanji + >> def + + % N A B K + /mids [ (0001) (0010) (0100) (1000) ] def + /mids << + /M1 [ () -1 -1 -1 ] + /M2 [ (0) (1) -1 -1 ] + /M3 [ (00) (01) (10) (11) ] + /M4 [ (000) (001) (010) (011) ] + 1 1 40 {2 string 10 exch cvrs mids} for + >> def + + % N A B K + /cc1to9 [ 10 9 8 8 ] def + /cc10to26 [ 12 11 16 10 ] def + /cc27to40 [ 14 13 16 12 ] def + /cclens << + /M1 [ 3 -1 -1 -1 ] + /M2 [ 4 3 -1 -1 ] + /M3 [ 5 4 4 3 ] + /M4 [ 6 5 5 4 ] + 1 1 9 { 2 string 10 exch cvrs cc1to9 } for + 10 1 26 { 2 string 10 exch cvrs cc10to26 } for + 27 1 40 { 2 string 10 exch cvrs cc27to40 } for + >> def + + % Alphanumeric character to value map + /charmap (0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:) def + /charvals 44 dict def + 0 1 44 {dup charmap exch get exch charvals 3 1 roll put} for + + /encnumeric { + /in exch def + /out in length 10 mul 3 idiv 1 add string def + /i 0 def /j 0 def { + i in length eq {exit} if + i in length 2 sub lt { + (0000000000) 10 string copy + dup in i 3 getinterval cvi + 2 10 string cvrs dup length 10 exch sub exch putinterval + /i i 3 add def + } { + i in length 2 sub eq { % Two final digits + (0000000) 7 string copy + dup in i 2 getinterval cvi + 2 7 string cvrs dup length 7 exch sub exch putinterval + /i i 2 add def + } { % One final digit + (0000) 4 string copy + dup in i 1 getinterval cvi + 2 4 string cvrs dup length 4 exch sub exch putinterval + /i i 1 add def + } ifelse + } ifelse + dup out exch j exch putinterval + length j add /j exch def + } loop + out 0 j getinterval + } bind def - % Determine smallest symbol version to hold given amount of byte-encoded data + /encalphanumeric { + /in exch def + /out in length 11 mul 2 idiv 1 add string def + /i 0 def /j 0 def { + i in length eq {exit} if + i in length 1 sub lt { + (00000000000) 11 string copy + dup charvals in i get get 45 mul charvals in i 1 add get get add + 2 11 string cvrs dup length 11 exch sub exch putinterval + /i i 2 add def + } { + (000000) 6 string copy + dup charvals in i get get + 2 6 string cvrs dup length 6 exch sub exch putinterval + /i i 1 add def + } ifelse + dup out exch j exch putinterval + length j add /j exch def + } loop + out 0 j getinterval + } bind def + + /encbyte { + /in exch def + /out in length 8 mul string def + 0 1 in length 1 sub { + /i exch def + (00000000) 8 string copy + dup in i get cvi + 2 8 string cvrs dup length 8 exch sub exch putinterval + out i 8 mul 3 -1 roll putinterval + } for + out + } bind def + + /enckanji { + /in exch def + /out in length 2 idiv 13 mul string def + /i 0 def /j 0 def { + i in length eq {exit} if + in i get 256 mul in i 1 add get add + dup 16#E040 lt {16#8140} {16#C140} ifelse sub + dup -8 bitshift 16#C0 mul exch 16#00FF and add + (0000000000000) 13 string copy + dup 3 -1 roll 2 13 string cvrs dup length 13 exch sub exch putinterval + dup out exch j exch putinterval + length j add /j exch def + /i i 2 add def + } loop + out + } bind def + + % Determine a compact encoding for the data + encoding (unset) eq { + /numericokay true def + /alphanumericokay true def + /kanjiokay true def + /byteokay true def + barlen 2 mod 0 ne {/kanjiokay false def} if + 0 1 barlen 1 sub { + /i exch def + /barchar barcode i get def + barchar 48 lt barchar 57 gt or {/numericokay false def} if + charvals barchar known not {/alphanumericokay false def} if + i 2 mod 0 eq { + barchar 16#81 lt barchar 16#9F gt or + barchar 16#E0 lt barchar 16#EB gt or and { + /kanjiokay false def + } if + } if + } for + byteokay {/encoding (byte) def} if + kanjiokay {/encoding (kanji) def} if + alphanumericokay {/encoding (alphanumeric) def} if + numericokay {/encoding (numeric) def} if + } if + + % Determine smallest symbol version to hold given amount of data + /numchars barlen encoding (kanji) eq {2 idiv} if def version (unset) eq { - /caps [ - [ - 17 32 53 78 106 134 154 192 230 271 % 1-L - 10-L - 321 367 425 458 520 586 644 718 792 858 % 11-L - 20-L - 929 1003 1091 1171 1273 1367 1465 1528 1628 1732 % 21-L - 30-L - 1840 1952 2068 2188 2303 2431 2563 2699 2809 2953 % 31-L - 40-L - ] [ - 14 26 42 62 84 106 122 152 180 213 % 1-M - 10-M - 251 287 331 362 412 450 504 560 624 666 % 11-M - 20-M - 711 779 857 911 997 1059 1125 1190 1264 1370 % 21-M - 30-M - 1452 1538 1628 1722 1809 1911 1989 2099 2213 2331 % 31-M - 40-M - ] [ - 11 20 32 46 60 74 86 108 130 151 % 1-Q - 10-Q - 177 203 241 258 292 322 364 394 442 482 % 11-Q - 20-Q - 509 565 611 661 715 751 805 868 908 982 % 21-Q - 30-Q - 1030 1112 1168 1228 1283 1351 1423 1499 1579 1663 % 31-Q - 40-Q - ] [ - 7 14 24 34 44 58 64 84 98 119 % 1-H - 10-H - 137 155 177 194 220 250 280 310 338 382 % 11-H - 20-H - 403 439 461 511 535 593 625 658 698 742 % 21-H - 30-H - 790 842 898 958 983 1051 1093 1139 1219 1273 % 31-H - 40-H - ] - ] def - /caps caps (LMQH) eclevel search pop length exch pop exch pop get def - /i 1 def - { - barlen caps i 1 sub get le {exit} if + /caps format (full) eq {fullcaps} {microcaps} ifelse encoding get eclevel get def + /i 1 def { + numchars caps i 1 sub get le {exit} if /i i 1 add def } loop /version i 10 2 string cvrs def + format (micro) eq { + /version (M ) 2 string copy dup version 1 exch putinterval def + } if } if - % Set the control character data for the version - /mid (0100) def /term (0000) def /cclen 8 def - version 0 1 getinterval (M) ne { % Version 10 and above - version cvi 10 ge {/cclen 16 def} if - } if - /midlen mid length def - /termlen term length def + % Opportunistically raise the error correction level for a fit to the same symbol + /caps format (full) eq {fullcaps} {microcaps} ifelse encoding get def + /verval format (full) eq {version cvi 1 sub} {version 1 get 49 sub} ifelse def + eclevel (L) eq {numchars caps /M get verval get le {/eclevel (M) def} if} if + eclevel (M) eq {numchars caps /Q get verval get le {/eclevel (Q) def} if} if + eclevel (Q) eq {numchars caps /H get verval get le {/eclevel (H) def} if} if - % Create the bitstream as byte_mode_id character_count data_bytes term - /msgbits midlen cclen add barlen 8 mul add termlen add string def - msgbits 0 mid putinterval + % Set the control character data for the version + /mid mids version get encvals encoding get get def + /cclen cclens version get encvals encoding get get def + + % Create the bitstream as mode_id character_count encoded_data + /enc barcode encs encoding get load exec def (0000000000000000) 0 cclen getinterval cclen string copy - dup barlen cvi 2 cclen string cvrs dup length cclen exch sub exch putinterval + dup barlen encoding (kanji) eq {2 idiv} if cvi + 2 cclen string cvrs dup length cclen exch sub exch putinterval /cc exch def - msgbits midlen cc putinterval - 0 1 barlen 1 sub { - /i exch def - (00000000) 8 string copy dup barcode i get cvi 2 8 string cvrs dup length 8 exch sub exch putinterval - msgbits midlen cclen add i 8 mul add 3 -1 roll putinterval - } for - msgbits midlen cclen add barlen 8 mul add term putinterval + /msgbits mid length cclen add enc length add string def + msgbits 0 mid putinterval + msgbits mid length cc putinterval + msgbits mid length cclen add enc putinterval } ifelse @@ -12932,14 +13042,29 @@ begin okay {exit} if /i i 1 add def } loop + /format frmt def /version vers def /dcpb dcws ecb1 ecb2 add idiv def % Base data codewords per block /ecpb ncws ecb1 ecb2 add idiv dcpb sub def % Error correction codewords per block + % Complete the message bits by adding the terminator, truncated if neccessary + /terms << + /M1 (000) + /M2 (00000) + /M3 (0000000) + /M4 (000000000) + >> def + /term terms version known {terms version get} {(0000)} ifelse def + /term term 0 dmod msgbits length sub term length 2 copy gt {exch} if pop getinterval def + msgbits length term length add string + dup 0 msgbits putinterval + dup msgbits length term putinterval + /msgbits exch def + % Expand the message bits by adding padding as necessary /pad dmod string def - 0 4 dmod 1 sub {pad exch (0000) putinterval} for + 0 1 pad length 1 sub {pad exch 48 put} for pad 0 msgbits putinterval /padstrs [ (11101100) (00010001) ] def /padnum 0 def @@ -13433,7 +13558,7 @@ end % --BEGIN ENCODER maxicode-- % --DESC: MaxiCode -% --EXAM: [\)>^03001^02996152382802^029840^029001^0291Z00004951^029UPSN^02906X610^029159^0291234567^0291/1^029^029Y^029634 ALPHA DR^029PITTSBURGH^029PA^029^004 +% --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 /setpacking where {pop currentpacking true setpacking} if @@ -14734,8 +14859,8 @@ begin /pixs pixs /pixx cols /pixy rows - /height rows 72 div 1.5 mul - /width cols 72 div 1.5 mul + /height rows 72 div 2 mul + /width cols 72 div 2 mul /opt options >> @@ -16562,6 +16687,147 @@ end /setpacking where {pop setpacking} if % --END ENCODER gs1-128composite-- +% --BEGIN ENCODER gs1datamatrix-- +% --REQUIRES datamatrix-- +% --DESC: GS1 Data Matrix +% --EXAM: (01)03453120000011(17)120508(10)ABCD1234(410)9501101020917 +% --EXOP: +% --RNDR: renmatrix +/setpacking where {pop currentpacking true setpacking} if +1 dict +dup /renmatrix dup /uk.co.terryburton.bwipp findresource put +dup /datamatrix dup /uk.co.terryburton.bwipp findresource put +begin +/gs1datamatrix { + + 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 + + % 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 + + % 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 + /aival 2 dict 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 + aival 3 1 roll expand put + } loop + pop + + % Pre-defined fixed length data field AIs + % any AI whose prefix is not included in this table must be + % terminated with "FNC1", even if it's fixed length + /aifixed 23 dict def + [ + 0 1 4 {} for + ] { + (00) 2 string copy dup dup 1 5 -1 roll 48 add put aifixed 3 1 roll put + } forall + [ + 11 1 20 {} for + 23 + 31 1 36 {} for + 41 + ] { + 10 2 string cvrs dup aifixed 3 1 roll put + } forall + + % Create the datamatrix data + /fnc1 -1 def + /dmtx [ fnc1 ] def + 0 1 ais length 1 sub { + /i exch def + /ai ais i get def + /val aival ai get def + dmtx length ai length add val length add array + dup 0 dmtx putinterval + dup dmtx length ai [ exch {} forall ] putinterval + dup dmtx length ai length add val [ exch {} forall ] putinterval + /dmtx exch def + i ais length 1 sub ne aifixed ai 0 2 getinterval known not and { % Append FNC1 + dmtx length 1 add array + dup 0 dmtx putinterval + dup dmtx length fnc1 put + /dmtx exch def + } if + } for + + % Compose input to datamatrix + /barcode dmtx length 1 add 5 mul string def + /i 0 def /j 0 def { + i dmtx length eq {exit} if + dmtx i get dup fnc1 eq { + pop barcode j (^FNC1) putinterval + /j j 4 add def + } { + barcode exch j exch put + } ifelse + /i i 1 add def + /j j 1 add def + } loop + /barcode barcode 0 j getinterval def + + % Get the result of encoding with code128 + options (dontdraw) true put + options (parsefnc) true put + /args barcode options //datamatrix exec def + + args (opt) options put + args + + dontdraw not //renmatrix if + + end + +} bind def +/gs1datamatrix dup load /uk.co.terryburton.bwipp defineresource pop +end +/setpacking where {pop setpacking} if +% --END ENCODER gs1datamatrix-- + % --BEGIN ENCODER hibccode39-- % --REQUIRES code39-- % --DESC: HIBC Code 39 diff --git a/Master/texmf-dist/source/generic/pst-barcode/Makefile b/Master/texmf-dist/source/generic/pst-barcode/Makefile index d8bd75bc545..a739a8a6c13 100644 --- a/Master/texmf-dist/source/generic/pst-barcode/Makefile +++ b/Master/texmf-dist/source/generic/pst-barcode/Makefile @@ -60,6 +60,7 @@ tds: # cp -u Changes $(TDS)/dvips/$(PACKAGE)/ cp -u $(PACKAGE).pro $(TDS)/dvips/$(PACKAGE)/ + cp -u $(PACKAGE).pro ~/Links/dvips-local/ # cp -u Changes $(TDS)/source/$(PACKAGE)/ cp -u $(MAIN).tex $(TDS)/source/$(PACKAGE)/ diff --git a/Master/texmf-dist/tex/generic/pst-barcode/pst-barcode.tex b/Master/texmf-dist/tex/generic/pst-barcode/pst-barcode.tex index 7346c8f938a..43d0f4f18b5 100644 --- a/Master/texmf-dist/tex/generic/pst-barcode/pst-barcode.tex +++ b/Master/texmf-dist/tex/generic/pst-barcode/pst-barcode.tex @@ -19,8 +19,8 @@ \let\PSTBarcodeLoaded\endinput \ifx\PSTricksLoaded\endinput\else\input pstricks.tex\fi % -\def\fileversion{0.08} -\def\filedate{2011/03/10} +\def\fileversion{0.09} +\def\filedate{2012/06/25} \message{`PST-barcode' v\fileversion, \filedate\space (tb,hv)} % \edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax |