I use pdflatex and I am interested in using \psbarcode from \usepackage{pst-barcode}. I think I found the answer in the last post here but the explanation starts with run pdflatex -shell-escape <file> How and where to do this? Could you please give me an example with some file name and file extension. I suppose I have to write .tex? I work on Windows 7. I use TeXnicCenter.
Asked
Active
Viewed 1,558 times
1
1 Answers
2
It is better to separate codes to generate diagrams from the main TeX input file. Here I put the code to generate barcode in a single separate file called mybarcode.tex for example.
%compile it with xelatex or the combo sequence latex-dvips-ps2pdf
%it is mybarcode.tex
\documentclass{article}
\usepackage{pst-barcode}
\usepackage[tightpage,active]{preview}
\PreviewBorder=0pt
\PreviewEnvironment{pspicture}
\begin{document}
\begin{pspicture}[showgrid=false](1.49,1.49)% I got this value by inspection (zooming up to 1000%)
\psbarcode{tug.org}{}{qrcode}
\end{pspicture}
\end{document}
Compiling mybarcode.tex with xelatex or latex-dvips-ps2pdf, you will get mybarcode.pdf as follows:

From within your main TeX input file, you can import the PDF using \includegraphics[scale=2]{mybarcode} macro provided by graphicx.
kiss my armpit
- 36,086
-
for
xelatexthere is no need for loadingpreviewandpspictureis already defined as a preview environment. However, using\usepackage[pdf]{pstricks}simplifies the whole setting. – Jun 04 '12 at 16:02 -
-
-
-
for the PostScript part
latexand for the document that program what the user started,pdflatexorxelatex– Jun 05 '12 at 11:01
xelatexinstead ofpdflatex– Jun 04 '12 at 14:59