0

I am using pst-barcode to create qr code on page. I would like to be able to put a different qr code on every even page at the same place. I have no clue how to enforce absolute location of pspicture.

  • How to position it absolute with overlaying the text?
  • How to enforce page number?

    \documentclass{article}
    \usepackage{pst-barcode}
    \begin{document}
      \begin{pspicture}(1in,1in)
         \psbarcode{testestestse}{}{qrcode}
       \end{pspicture}
    \end{document}
    
Tomas
  • 151

1 Answers1

1

In the end, I figured it out.

\documentclass{article}
\usepackage{geometry,lipsum,xcolor}
\geometry{showframe,margin=1in}
\usepackage{eso-pic}
\usepackage{pst-barcode}
\usepackage{ifthen}
\usepackage{everypage}
\usepackage{fmtcount}

\newcommand{\qrqr}{
\AddToShipoutPictureFG*{%
  \AtTextLowerLeft{
  \ifthenelse{\isodd{\value{page}}}
  {}
  {
  \begin{pspicture}(1in,1in)

     \psbarcode{\thepage}{}{qrcode}
   \end{pspicture}
  }
  }%
}%
}

\begin{document}
\AddEverypageHook{\qrqr}
\lipsum[3-56]
\end{document}
Tomas
  • 151