3

As the treasurer of an association it's my duty to send out yearly invoices for membership dues. I use scrlttr2 on LuaLaTeX for that, and it's working fine. To allow for easier payment, I am using a QR-Code containing the relevant payment info. That, too, works largely as expected:

\documentclass{scrlttr2}

\usepackage[absolute]{textpos}
\usepackage[forget]{qrcode}

% \usepackage[ngerman]{babel} % Not used due to conflict with qrcode

\setkomavar{signature}{Nomen Nescio, Honcho in Chief} 

\begin{document}
\begin{letter}{To: All members}

\opening{Dear all,}

Please pay up!

\closing{Kthanksbye,}

\begin{textblock*}{10cm}(13.5cm,22cm)%
  \begin{minipage}[c]{7cm} % use \? for newline, all spaces must be prefixed with \
\qrcode[height=4cm,level="M"]{BCD\?001\?1\?SCT\?ABCDATWW\?Applepie\ Appreciation\ Society\?AT611904300234573201\?EUR90\?\?MyUniqueReference\?\?}
    \end{minipage}
  \end{textblock*}

\end{letter}
\end{document}

enter image description here

Apparently there is some software or app, however, that doesn't recognize these codes unless they have a specific border drawn around them like this:

enter image description here

Is there an easy way to draw that border with LaTeX (TikZ?), or do I have to use a transparent image of the border and just position it on top of the created QR-Code? (Using \AddToShipoutPicture or something similar is my plan B at this point.)

4
  • 2
    How about adding a simple \fbox to it? If this does not work I would suffest the tcolorboxpackage. Dec 14 '20 at 19:46
  • 2
    Is the text on the right side mandatory, or only the frame?
    – Bernard
    Dec 14 '20 at 19:49
  • I don't actually know, to be honest. I'll need to get in touch with that user and test, but I think without the text would be fine for now.
    – Ingmar
    Dec 14 '20 at 20:20
  • Actually, the text was relatively easy. I used \rotatebox{90}{\colorbox{white}{Zahlen mit Code}} insided another \begin{textblock*} and got it all to work.
    – Ingmar
    Dec 14 '20 at 21:08
3

Thanks to your comments and contributions I was able to get it to work:

\documentclass{scrlttr2}

\usepackage[absolute]{textpos}
\usepackage[forget]{qrcode}
\usepackage{tcolorbox}
\usepackage[shorthands=off,ngerman]{babel}

\setkomavar{signature}{Nomen Nescio, Honcho in Chief} 

\begin{document}
\begin{letter}{To: All members}

\opening{Dear all,}

Please pay up!

\closing{Kthanksbye,}

\begin{textblock*}{10cm}(13.5cm,22cm)%
  \begin{minipage}[c]{6,75cm} % use \? for newline, all spaces must be prefixed with \

\begin{tcolorbox}[colback=white,grow to right by=-17mm]
\qrcode[height=4cm,level="M"]{BCD\?001\?1\?SCT\?ABCDATWW\?Applepie\ Appreciation\ Society\?AT611904300234573201\?EUR90\?\?MyUniqueReference\?\?}
\end{tcolorbox}

    \end{minipage}
  \end{textblock*}

\begin{textblock*}{2cm}(18.25cm,23cm)%
\rotatebox{90}{\colorbox{white}{Zahlen mit Code}}
\end{textblock*}

\end{letter}
\end{document}

enter image description here

2

Without the text I would suggest:

\documentclass{scrlttr2}

\usepackage[absolute]{textpos}
\usepackage[forget]{qrcode}
\usepackage{tcolorbox}
\usepackage{lipsum}

\definecolor{mycolor}{rgb}{0.122, 0.435, 0.698}


% \usepackage[ngerman]{babel} % Not used due to conflict with qrcode

\setkomavar{signature}{Nomen Nescio, Honcho in Chief} 

\begin{document}
\begin{letter}{To: All members}

\opening{Dear all,}

Please pay up!

\closing{Kthanksbye,}

\begin{textblock*}{10cm}(13.5cm,22cm)%
  \begin{minipage}[c]{7cm} % use \? for newline, all spaces must be prefixed with \

\begin{tcolorbox}[colback=white,grow to right by=-17mm]
\qrcode[height=4cm,level="M"]{BCD\?001\?1\?SCT\?ABCDATWW\?Applepie\ Appreciation\ Society\?AT611904300234573201\?EUR90\?\?MyUniqueReference\?\?}
\end{tcolorbox}
    \end{minipage}
  \end{textblock*}

\end{letter}
\end{document}
1
  • 1
    Thanks for pointing me in the right direction. I was able to get it to work: Using another \begin{textblock*} environment the text, it's working good now.
    – Ingmar
    Dec 14 '20 at 21:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.