GeneralBarcodes in LaTeX (code128)

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 (code128)

Post by molasar »

Hi,

I need to use bascodes (code128) in my documents (PDF-files).
I use next:

\usepackage{pst-barcode,pstricks-add}
\psset{unit=1in}
\begin{pspicture}(3.5,1.2)
\psbarcode{12345678}{includetext}{code128}
\end{pspicture}

,but page is empty.

Maybe I have to install something else?
And how can check that pst-barcode have installed corectly?
Maybe you know another way to print barcodes?

Thank you.

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

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Barcodes in LaTeX (code128)

Post by gmedina »

Hi,

please take into account the notes in the pst-barcode documentation (page 11) regarding code128:
documentation wrote: 4.9 Code-128 and UCC/EAN-128

Characters !"#$%&’\(\)*+,-./0...9:;<=>?@A...Z[\\]^_‘a...z{|}~

Data Variable number of ASCII characters and special funtion symbols, starting with the approriate start character for the initial character set. UCC/EAN-128s must have a manditory FNC 1 symbol immediately following the start character...

Code: Select all

\documentclass[a4paper,12pt]{report}
\usepackage{pst-barcode,pstricks-add}

\begin{document}

\psset{unit=1in}
\begin{pspicture}(3.5,1.2)
\psbarcode{^10412345678}{includetext}{code128}
\end{pspicture}

\end{document}
I really have no idea about barcodes, but the above code produces one (see attachment).
Attachments
test.pdf
(4.24 KiB) Downloaded 895 times
1,1,2,3,5,8,13,21,34,55,89,144,233,...
molasar
Posts: 5
Joined: Tue Feb 26, 2008 5:44 pm

Re: Barcodes in LaTeX (code128)

Post by molasar »

FreeBSD 6.1 + teTeX-base-3.0_6 + teTeX-texmf-3.0_3

I used your way:
1. Make file test.tex:

\documentclass[a4paper,12pt]{report}
\usepackage{pst-barcode,pstricks-add}
\begin{document}
\psset{unit=1in}
\begin{pspicture}(3.5,1.2)
\psbarcode{^10412345678}{includetext}{code128}
\end{pspicture}
\end{document}

2. texi2dvi test.tex -> ok
3. dvipdfm -p a4 -o test.pdf test.dvi -> errors:
test.dvi -> test.pdf
[1
Unrecognized special ignored
Current input buffer is -->header=pstricks.pro<--

Unrecognized special ignored
Current input buffer is -->header=pst-dots.pro<--

Unrecognized special ignored
Current input buffer is -->header=pst-barcode.pro<--

Unrecognized special ignored
Current input buffer is -->header=pst-node.pro<--

Unrecognized special ignored
Current input buffer is -->header=pst-eqdf.pro<--

Unrecognized special ignored
Current input buffer is -->" tx@Dict begin STP newpath 0.8 SLW 0 setgray g...
<--
]
5211 bytes written

4. test.pdf is empty page without barcode.
What I need to do to solve my problem?

Thank you.
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Re: Barcodes in LaTeX (code128)

Post by gmedina »

Those errors come from compiling from dvi directly to pdf. You must first convert the dvi file to ps and finally to pdf:

latex test.tex (or texi2dvi test.tex)
dvips test.dvi
ps2pdf test.ps
1,1,2,3,5,8,13,21,34,55,89,144,233,...
molasar
Posts: 5
Joined: Tue Feb 26, 2008 5:44 pm

Re: Barcodes in LaTeX (code128)

Post by molasar »

aha...
I use FreeBSD 6.1.
For 'latex' command I have installed 'teTeX-base' package.
And when I tried to istall DVIPS package for 'dvips' command,
I had an error, that DVIPS and teTeX-base conflicted. And I need to use only one.
But DVIPS dont have 'latex' command...

What packages I need to install for use next command:
- latex
- dvips
- ps2pdf

Thank you.
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Barcodes in LaTeX (code128)

Post by gmedina »

Hi,

teTeX has been declared obsolote for over two years! (see this thread) Please uninstall it and intall some up-to-date LaTeX system (TeX Live, for example).
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply