# Rendering a pspicture inside another document

I have a C++ program that generates a PDF via LaTeX by writing the data to stdout and piping to pdflatex -shell-escape.

The template looks like this:

\documentclass[letterpaper,12pt]{article}
\pagestyle{empty}
\usepackage{pstricks,auto-pst-pdf,pst-barcode}
\setlength{\hoffset}{-0.7in}
\setlength{\voffset}{-0.600000in}
\setlength{\textwidth}{8.0in}
\setlength{\textheight}{11in}
\setlength{\topskip}{0in}
\setlength{\topmargin}{0in}
\setlength{\topskip}{0in}
\setlength{\footskip}{0in}
\setlength{\oddsidemargin}{0in}
\setlength{\evensidemargin}{0in}
\setlength{\parindent}{0ex}
\setlength{\parskip}{0ex}
\renewcommand{\baselinestretch}{0.9}
\begin{document}

\begin{tabular}{p{3.61in}p{3.39in}}
\begin{tabular}{lrrrr}

\multicolumn{5}{l}{Item1: .; Item2: .; Item3: .}\\
\end{tabular} &
\begin{tabular}{c}
{\Huge\textbf{100}}\\
\begin{pspicture}(0.7,0.7)
\psbarcode{100}{}{qrcode}
\end{pspicture}
{\Huge\textbf{}}\\
\\
\end{tabular}
\end{tabular}

\clearpage
\end{document}


When I attempt to compile this I get "Package pst-pdf Warning: pspicture No. 1 undefined."

The rest of the document is generated but the embedded QR code is not.

Sorry for the large example, but the pspicture statements on their own work just fine so I'm not sure which part of the document is causing it to not work.

Can somebody tell me what I'm doing wrong?

• try \psbarcode{100}{}{qrcode} – Marijn Jun 30 '16 at 17:21
• Write this as an answer! – user2478 Jun 30 '16 at 17:29
• Thank you for the suggestion! However, I tried this and I still get the same error. – George Jun 30 '16 at 17:52
• So after a bit more testing it looks like I'm doing something else wrong -- if i 'pipe' this output to pdflatex (as opposed to storing it in a tex file and compiling the text file), that breaks it. however, storing it in a tex file and then compiling it works fine. – George Jun 30 '16 at 18:21
• @George you should make that an answer. – naphaneal Jun 30 '16 at 20:35