GeneralBarcodes in LaTeX

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
molasar
Posts: 5
Joined: Tue Feb 26, 2008 5:44 pm

Barcodes in LaTeX

Post by molasar »

Hi!
FreeBSD 6.1 + LaTeX (from teTeX-base port).
What is the easy way to make PDF file with barcodes?

I try next three steps:

1. Using code39.tex:
\input code39.tex
\begincodethirtynine{126779}\endcodethirtynine
Latex said:
! I can't find file `code39.tex'.
In what directory I need to place code39.tex file?

2. Using wlc39.mf:
\newcommand{\barcode}[1]{{\xlix@#1@}}
\font\xlix=wlc39 scaled 1100
scaled 1100 \barcode{956796;1}
LaTeX said:
! I can't find file `wlc39'.
In what directory I need to place wlc39.mf file?

3. Using pst-barcode:
\begin{pspicture}(3.5,1.2in)
\psbarcode{12345678}{includetext}{ean8}
\end{pspicture}
Latex said:
! LaTeX Error: Environment pspicture undefined.
What I need to define this inveronment?

Please, help me.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Barcodes in LaTeX

Post by localghost »

Take a look at what CTAN offers for generating barcodes. Using the pst-barcode version, you may have to include the pstricks-add package.

Code: Select all

\usepackage{pst-barcode,pstricks-add}
The pspicture environment doesn't accept units directly. Setting units is done by the \psset command.

Code: Select all

\psset{unit=1in}
\begin{pspicture}(3.5,1.2)
  \psbarcode{12345678}{includetext}{ean8}
\end{pspicture}
For more information refer to the documentation of the PSTricks package.


Best regards
Thorsten¹
molasar
Posts: 5
Joined: Tue Feb 26, 2008 5:44 pm

Re: Barcodes in LaTeX

Post by molasar »

Thanks for answer, but I solved this problem by next:

2. Using wlc39.mf:
\newcommand{\barcode}[1]{{\xlix@#1@}}
\font\xlix=wlc39 scaled 1100
scaled 1100 \barcode{956796;1}
LaTeX said:
! I can't find file `wlc39'.
In what directory I need to place wlc39.mf file?

I placed wlc39.mf to:
/usr/local/share/textmf-dist/source/public/barcode2/

And now it's ok
Post Reply