Debian Codegraph @

texmf-dist/doc/generic/pst-barcode/pst-barcode-doc.ltx

raw
1 %% $Id: pst-barcode-doc.ltx 1252 2026-05-18 05:25:50Z herbert $
2 \DocumentMetadata{lang=en}
3 \documentclass[11pt,english,bibliography=totoc,parskip=false,headings=small,
4 headinclude=false,footinclude=false,twoside,usegeometry]{pst-doc}
5 \usepackage{pst-barcode, blindtext}%,multicol}
6
7 \addbibresource{\jobname.bib}
8
9 \RequirePackage{minted-code}
10 \hypersetup{colorlinks,
11 urlcolor=pdfurlcolor,
12 filecolor=pdffilecolor,
13 linkcolor=pdflinkcolor,
14 % breaklinks,
15 linktoc=all,
16 linktocpage=true
17 }
18 \geometry{inner=1.5cm,outer=2cm,marginparwidth=1.5cm,marginparsep=2mm}
19
20 \let\pstBarcodeFV\fileversion
21 \lstset{preset=\centering,pos=l,wide=false,vsep=5mm,language=PSTricks,%width=0.5\linewidth,
22 morekeywords={multidipole,parallel},basicstyle=\footnotesize\ttfamily}
23
24 \RedeclareSectionCommand[
25 afterskip=3pt plus 1pt minus 1pt,
26 beforeskip=4pt plus 1pt minus 1pt]{paragraph}
27 \RedeclareSectionCommand[
28 afterskip=3pt plus 1pt minus 1pt,
29 beforeskip=4pt plus 1pt minus 1pt]{subparagraph}
30 \setcounter{tocdepth}{3}
31 \setcounter{secnumdepth}{3}
32 %
33 \def\bgImage{\begin{pspicture}(1in,1in)
34 \psbarcode{Herbert Voss Freie Universitaet Berlin}{rows=52 columns=52}{datamatrix}
35 \end{pspicture}}
36
37 \begin{filecontents*}[force]{demo.tex}
38 \documentclass{article}
39 \usepackage{pst-barcode,fancyvrb}
40 \begin{document}
41 \VerbatimInput{\jobname.tex}% test
42
43 \begin{pspicture}(2in,2in)
44 \psbarcode[file]{\jobname.tex}{}{qrcode}
45 \end{pspicture}
46 \end{document}
47 \end{filecontents*}
48
49 \def\tightlist{\parskip=0pt%\itemskip=0pt
50 }
51
52
53 \begin{document}
54
55 \title{\texttt{pst-barcode}}
56 \subtitle{A PSTricks package for drawing barcodes; v.\pstBarcodeFV}
57 \author{Terry Burton \\Herbert Voß}
58 %\docauthor{Herbert Vo\ss}
59 \date{\today}
60 \settitle
61
62 \tableofcontents
63
64 \clearpage
65
66 \begin{abstract}
67 \noindent
68 The \LPack{pstricks} related package provides (essentially) one macro
69 for printing barcodes. The type of the code is defined by a parameter
70 and passed to postscript.
71
72 For \texttt{lualatex} the package needs the latest version of \texttt{luapstricks.lua}.
73 Update your \TeX-installtion or get it from \url{https://github.com/zauguin/luapstricks}.
74 \end{abstract}
75
76 \vfill\noindent
77 Thanks to: \\
78 Jean-C\^ome Charpentier; Marcel Krüger; Mariusz Zynel.
79
80 \clearpage
81 \section{Introduction}
82 The \LPack{pstricks} package provides (essentially) one macro
83 for printing barcodes. The type of the code is defined by a parameter
84 and passed to postscript.
85 To install the package put the three files in a place, where \TeX{} will search
86 for the files:
87
88 \bigskip\noindent
89 \begin{tabular}{@{} l l l @{}}\hline
90 \emph{name} & \emph{meaning}& \emph{target dir} \\\hline
91 \verb+pst-barcode.tex+ & \LaTeX\ style file -- wrapper & \verb+$LOCALTEXMF/tex/generic/pstricks/+\\
92 \verb+pst-barcode.sty+ & \TeX\ file -- PS interface &\verb+$LOCALTEXMF/tex/latex/pstricks/+\\
93 \verb+pst-barcode.pro+ & PostScript file & \verb+$LOCALTEXMF/dvips/pstricks/+ \\
94 \verb+pst-barcode-doc.tex+ & documentation source & \verb+$LOCALTEXMF/doc/pstricks/+\\
95 \verb+pst-barcode-doc.bib+ & bibliography source & \verb+$LOCALTEXMF/doc/pstricks/+\\
96 \verb+pst-barcode-doc.pdf+ & documentation & \verb+$LOCALTEXMF/doc/pstricks/+ \\\hline%$
97 \end{tabular}
98
99 \bigskip
100 There is only one macro \verb+\psbarcode+ with the usual PSTricks syntax
101 \begin{BDef}
102 \Lcs{psbarcode}\OptArgs\Largb{text or filename}\Largb{PS options}\Largb{barcode type}
103 \end{BDef}
104
105 Important is the fact, that the barcode is printed in a \TeX\ box of zero dimension.
106 If you want to save some space in your text, use the \Lenv{pspicture} environment
107 or the \Lcs{makebox} macro.
108
109
110
111 \section{The options}
112 \subsection{The \TeX\ options}
113
114 \begin{tabular}{@{}lll@{}}\hline
115 \emph{name} & \emph{default} & \emph{remarks}\\\hline
116 \Lkeyword{transx} & 0 & horizontal shift\\
117 \Lkeyword{transy} & 0 & vertical shift\\
118 \Lkeyword{scalex} & 1 & horizontal scaling\\
119 \Lkeyword{scaley} & 1 & vertical scaling\\
120 \Lkeyword{rotate} & 0 & rotating angle in degrees\\\hline
121 \Lkeyword{file} & false & load an external file for the text\\\hline
122 \end{tabular}
123
124
125 \subsection{The PostScript options}
126
127 \begin{tabularx}{\textwidth}{@{}llX@{}}\hline
128 \emph{name} & \emph{default} & \emph{remarks}\\\hline
129 \Lps{height} & 1 & dimension is inch\\
130 \Lps{textsize} & 10 & dimension is pt\\
131 \Lps{textpos} & -2 & dimension is pt; it is the shift for additional code text\\
132 \Lps{inkspread} & 0.15 & dimension is pt\\
133 \Lps{showborder} & -- & - \\
134 \Lps{borderwidth} & 0.5 & dimension in pt \\
135 \Lps{borderleft} & 10 & dimension in pt\\
136 \Lps{borderright} & 10 & dimension in pt\\
137 \Lps{bordertop} & 1 & dimension in pt\\
138 \Lps{borderbottom} & 1 & dimension in pt\\
139 \Lps{borderwidth} & 0.5 & dimension in pt\\
140 \Lps{width} & -- & dimension in inch\\
141 %
142 \Lps{font} & /Helvetica & must be a PostScript font\\
143 \Lps{includetext} & -- & enable human readable text \\
144 \Lps{includecheck} & -- & enable check digit \\
145 \Lps{includecheckintext} & -- & check digit visible in text\\
146 \Lps{parse} & -- & parse variable field für decimal values, like \^{}032 for space, and convert them to ASCII\\\hline
147 \end{tabularx}
148
149
150
151 \subsection{Examples for the TeX options}
152
153 \begin{exampleM}[]{Rotating and scaling}
154 \psframebox{\begin{pspicture}(2.5,1in)
155 \psbarcode{01335583}{includetext}{ean8}
156 \end{pspicture}}
157 \quad
158 \psframebox{\begin{pspicture}(-2.6,-1.5)(0.4,0.2in)
159 \psbarcode[rotate=180,linecolor=red]{01335583}{includetext guardwhitespace height=0.6}{ean8}
160 \end{pspicture}}
161 \quad
162 \psframebox{\begin{pspicture}(3.8,1in)
163 \psbarcode[scalex=1.5,scaley=0.5,transy=1]{01335583}{includetext inkspread=0.5}{ean8}
164 \end{pspicture}}
165 \end{exampleM}
166
167
168
169 \begin{exampleA}[]{Reading external file}
170 \begin{pspicture}(2in,2in)
171 \psbarcode[file]{demo.tex}{}{qrcode}
172 \end{pspicture}
173 \end{exampleA}
174
175 The contents of the external file \texttt{demo.tex}:
176
177 \VerbatimInput{demo.tex}
178
179
180
181
182
183 \newpage
184 \subsection{Examples for the PostScript options}
185
186 %\begin{LTXexample}[pos=t,preset=\centering]
187 \begin{exampleM}[]{PostScript options}
188 \begin{pspicture}(3.5,1.2in)
189 \psbarcode{01335583}{includetext guardwhitespace height=0.6}{ean8}
190 \end{pspicture}
191 \begin{pspicture}(3.5,1.2in)
192 \psbarcode{01335583}{textsize=15 includetext guardwhitespace height=0.6}{ean8}
193 \end{pspicture}
194 \begin{pspicture}(3.5,1.2in)
195 \psbarcode{01335583}{includetext inkspread=0.5}{ean8}
196 \end{pspicture}
197 \begin{pspicture}(3.5,1.2in)
198 \psbarcode{01335583}{includetext textpos=0}{ean8}
199 \end{pspicture}
200 \end{exampleM}
201
202
203
204 %\begin{LTXexample}[pos=t,preset=\centering]
205 \begin{exampleM}[]{PostScript options}
206 \begin{pspicture}(3.5,1.2in)
207 \psbarcode{01335583}{includetext guardwhitespace}{ean8}
208 \end{pspicture}
209 \begin{pspicture}(3.5,1.2in)
210 \psbarcode{01335583}{textsize=15 includetext guardwhitespace width=2}{ean8}
211 \end{pspicture}
212 \end{exampleM}
213
214
215
216
217
218 \section{Usage}
219 By default the barcode has a width and a height of zero. Using the \Lcs{parbox}
220 macro or the \Lenv{pspicture} environment can reserve the needed space for
221 the barcode. The \Lcs{fbox} in the following examples is used
222 only for demonstration.
223
224 \xLps{code39}
225 %\begin{LTXexample}[width=.5\linewidth]
226 \begin{exampleM}[]{Width and height}
227 foo
228 \fbox{%
229 \parbox[b][1in]{1.5in}{\psbarcode{241078}{includetext width=1.5 height=1}{code39}}}
230 bar
231 \end{exampleM}
232
233 \xLps{code39}
234 \bigskip
235 %\begin{LTXexample}[pos=l,width=.5\linewidth]
236 \begin{exampleA}[]{Width and height}
237 foo
238 \fbox{%
239 \begin{pspicture}(0,-8pt)(1.5in,1in)
240 \psbarcode{241078}{includetext width=1.5 height=1}{code39}
241 \end{pspicture}}
242 bar
243 \end{exampleA}
244
245
246 \section{Available Codes}
247
248 \begingroup
249 \ttfamily
250 \begin{compactitem}
251 \item EAN-13 (EAN, UCC-13, JAN, JAN-13, EAN-13+2, EAN-13+5, EAN-99),
252 \item EAN-8 (UCC-8, JAN-8, EAN-8+2, EAN-8+5, EAN-Velocity),
253 \item UPC-A (UPC, UCC-12, UPC-A+2, UPC-A+5),
254 \item UPC-E (UPC-E0, UPC-E1, UPC-E+2, UPC-E+5),
255 \item ISBN (ISBN-13, ISBN-10, Bookland EAN-13),
256 \item ISMN,
257 \item ISSN,
258 \item EAN-5 \& EAN-2 (EAN/UPC add-ons),
259 \item GS1 DataBar Omnidirectional (RSS-14),
260 \item GS1 DataBar Stacked (RSS-14 Stacked),
261 \item GS1 DataBar Stacked Omnidirectional (RSS-14 Stacked Omnidirectional),
262 \item GS1 DataBar Truncated (RSS-14 Truncated),
263 \item GS1 DataBar Limited (RSS Limited),
264 \item GS1 DataBar Expanded (RSS Expanded),
265 \item GS1 DataBar Expanded Stacked (RSS Expanded Stacked),
266 \item GS1-128 (UCC/EAN-128, EAN-128, UCC-128),
267 \item SSCC-18 (EAN-18, NVE),
268 \item EAN-14 (UCC-14),
269 \item ITF-14 (UPC SCS),
270 \item QR Code (Quick Response Code),
271 \item Micro QR Code,
272 \item GS1 QR Code,
273 \item Data Matrix (Data Matrix ECC 200, Data Matrix Rectangular Extension),
274 \item GS1 DataMatrix,
275 \item Aztec Code (Compact Aztec Code),
276 \item Aztec Runes,
277 \item PDF417,
278 \item Compact PDF417 (Truncated PDF417),
279 \item MicroPDF417,
280 \item Han Xin Code (Chinese Sensible),
281 \item MaxiCode (UPS Code, Code 6),
282 \item Codablock F,
283 \item Code 16K (USS-16K),
284 \item Code 49 (USS-49),
285 \item Code One (Code 1, Code 1S),
286 \item USPS POSTNET,
287 \item USPS PLANET,
288 \item USPS Intelligent Mail (USPS OneCode),
289 \item USPS FIM,
290 \item Royal Mail (RM4SCC, CBC),
291 \item Royal TNT Post (KIX),
292 \item Japan Post,
293 \item Australia Post,
294 \item Deutsche Post Identcode (DHL Identcode),
295 \item Deutsche Post Leitcode (DHL Leitcode),
296 \item Pharmacode (Pharmaceutical Binary Code),
297 \item Two-track Pharmacode (Two-track Pharmaceutical Binary Code),
298 \item Italian-Pharmacode (Code 32, IMH),
299 \item PZN (Pharmazentralnummer, PZN-8, PZN-7),
300 \item Code 39 (Code 3 of 9, LOGMARS, Alpha39, USD-3, USD-2, USS-39),
301 \item Code 39 Extended (Code 39 Full ASCII),
302 \item Code 93 (USD-7, USS-93),
303 \item Code 93 Extended (Code 93 Full ASCII),
304 \item Code 128 (Code 128A, Code 128B, Code 128C, USD-6, USS-128),
305 \item Code 25 (Code 2 of 5, Industrial 2 of 5),
306 \item IATA-2 of 5,
307 \item Datalogic 2 of 5,
308 \item Matrix 2 of 5,
309 \item COOP 2 of 5,
310 \item Interleaved 2 of 5 (ITF, Code 2 of 5 Interleaved, USD-1, USS-Interleaved 2 of 5),
311 \item Code 11 (USD-8),
312 \item Codabar (Rationalized Codabar, Ames Code, NW-7, USD-4, USS-Codabar, Monarch, Code 2 of 7),
313 \item Plessey (Anker Code),
314 \item MSI Plessey (MSI, MSI Modified Plessey),
315 \item Telepen (Telepen Alpha, Telepen Full ASCII),
316 \item Telepen Numeric,
317 \item Channel Code,
318 \item PosiCode (PosiCode A, PosiCode B),
319 \item BC412 (BC412 SEMI, BC412 IBM),
320 \item GS1 Composite Symbols (EAN-13 Composite, EAN-8 Composite, UPC-A Composite, UPC-E Composite, GS1 DataBar Omnidirectional Composite,
321 \item GS1 DataBar Stacked Composite, GS1 DataBar Stacked Omni Composite, GS1 DataBar Truncated Composite,
322 \item GS1 DataBar Limited Composite, GS1 DataBar Expanded Composite, GS1 DataBar Expanded Stacked Composite,
323 \item GS1-128 Composite),
324 \item HIBC barcodes (HIBC Code 39, HIBC Code 128, HIBC Data Matrix, HIBC PDF417, HIBC MicroPDF417, HIBC QR Code, HIBC Codablock F)
325 \end{compactitem}
326 \endgroup
327
328 %\clearpage
329
330
331
332 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
333 \input{pst-barcode-doc}
334 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
335
336
337 \clearpage
338 \newgeometry{inner=2cm,outer=4cm,marginparwidth=3cm,marginparsep=2mm}
339 \textwidth=\dimexpr\textwidth-1cm\relax
340
341 \section{QR code in the margin}
342 The marginnotes are placed with the help of the macro of the same name \Lcs{marginnote},
343 which itself needs package \LPack{narginnote}. It is loaded by default if the macro
344 doesn't exists.
345
346 \begin{lstlisting}
347 \QR[1]<barcode>{http://mirror.ctan.org/help/Catalogue/bytopic.html\#barcode}
348 \blindtext
349
350 {\psset{fontstyle=\scriptsize\ttfamily}%
351 \QR[1]{http://mirror.ctan.org/help/Catalogue/bytopic.html\#barcode}%
352 }
353 \blindtext
354
355 \QR{http://mirror.ctan.org/usergrps/dante/dtk/doc/beispiel.pdf}
356 \blindtext
357 \QR<Beispiel>{http://mirror.ctan.org/usergrps/dante/dtk/doc/beispiel.pdf}
358 \blindtext
359
360 \QR{http://de.wikipedia.org/wiki/QR-Code}
361 \blindtext
362 \end{lstlisting}
363
364 \QR[1]<barcode>{http://mirror.ctan.org/help/Catalogue/bytopic.html\#barcode}
365 \blindtext
366
367 {\psset{fontstyle=\scriptsize\ttfamily}%
368 \QR[1]{http://mirror.ctan.org/help/Catalogue/bytopic.html\#barcode}%
369 }
370 \blindtext
371
372 \QR{http://mirror.ctan.org/usergrps/dante/dtk/doc/beispiel.pdf}
373 \blindtext
374 \QR<Beispiel>{http://mirror.ctan.org/usergrps/dante/dtk/doc/beispiel.pdf}
375 \blindtext
376
377 \QR{http://de.wikipedia.org/wiki/QR-Code}
378 \blindtext
379
380 \restoregeometry
381
382 \section{List of all optional arguments for \texttt{pst-barcode}}
383
384 \xkvview{family=pst-barcode,columns={key,type,default}}
385
386
387 \bgroup
388 \raggedright
389 \nocite{*}
390 \printbibliography
391 \egroup
392
393 \printindex
394 \end{document}
395
396