[Tex/LaTex] How to properly align picture, text and QR-code vertically and horizontally

graphicshorizontal alignmentqrcodetabuvertical alignment

Similar to this earlier question of mine, but this time:
+a QR code,
itemize

Ideally, the picture, the text and the QR code should be vertically top-aligned; the text should horizontally stick to the image, and the
QR code to the right margin.

This is what I've managed so far, partially employing the tips from the abovementioned earlier question:
arrange Item Text QR
In the first attempt, the image and the text are well aligned, but the QR code not, neither vertically nor horizontally.
In the second attempt, the image and the QR code are vertically aligned, but the text not, and again the QR code produces an Overfull \hbox .

\documentclass[a4paper, 10pt]{scrartcl}

\usepackage[american]{babel}
\usepackage[utf8]{inputenx}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[a4paper, left=12.7mm, right=12.7mm, top=12.7mm, bottom=13mm]{geometry}
\usepackage{showframe}

\usepackage{tabu, booktabs}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\usepackage{qrcode}
\newlength\threeLines
\setlength{\threeLines}{12mm}

\begin{document}

\sffamily
\tabulinesep=0pt
\extrarowsep=0pt
\begin{tabu}{@{} X[l,1] X[l,18] X[r,1] @{}}
\includegraphics[width=\threeLines, height=\threeLines, valign=t]{example-image} &
{This text spans \par
Over Three Lines and \par
Should be close to the image} &
\qrcode[height=\threeLines]{https://tex.stackexchange.com/questions/289863/how-to-get-rid-of-vertical-offset-in-a-table-containing-pictures} \\
\end{tabu}

\vspace*{24pt}

\begin{tabu}{@{} X[l,1] X[l,18] X[r,1] @{}}
\toprule
\raisebox{-\height}[0pt][1.1\height]{\includegraphics[width=\threeLines, height=\threeLines, valign=t]{example-image}} &
{This text spans \par
Over Three Lines and \par
Should be close to the image} &
\raisebox{-\height}[0pt][1.1\height]{\qrcode[height=\threeLines]{https://tex.stackexchange.com/questions/289863/how-to-get-rid-of-vertical-offset-in-a-table-containing-pictures}} \\
\end{tabu}

\end{document}

It also seems very clumsy to me to manually set the column width ration to 18, but otherwise the horizontal distance between image and text grows too big.

So my question is: How to properly align the three elements? Something better than tabu(lar)? I would like to avoid TikZ if possible.

Best Answer

You could use a solution based on a combination of \parbox and \adjustbox which would better up the vertical alignment.

aligning

\documentclass[a4paper, 10pt]{scrartcl}
\usepackage[american]{babel}
\usepackage{lmodern}
\usepackage[a4paper, left=12.7mm, right=12.7mm, top=12.7mm, bottom=13mm]{geometry}
\usepackage{showframe}

\usepackage{graphicx}
\usepackage[export]{adjustbox}
\usepackage{qrcode}
\newlength\threeLines
\setlength{\threeLines}{12mm}

\begin{document}

\noindent
\includegraphics[width=\threeLines, height=\threeLines, valign=t]{example-image}%
\adjustbox{valign=t}{\parbox[t]{5cm}{This text spans\\
Over Three Lines and\\
Should be close to the image}}\hfill
\adjustbox{valign=t}{\qrcode[height=\threeLines]{http://tex.stackexchange.com/questions/289863/how-to-get-rid-of-vertical-offset-in-a-table-containing-pictures}}

\vspace*{24pt}\hrule\vspace*{5pt}

\noindent
\includegraphics[width=\threeLines, height=\threeLines, valign=t]{example-image}%
\adjustbox{valign=t}{\parbox[t]{5cm}{This text spans\\
Over Three Lines and\\
Should be close to the image}}\hfill
\adjustbox{valign=t}{\qrcode[height=\threeLines]{http://tex.stackexchange.com/questions/289863/how-to-get-rid-of-vertical-offset-in-a-table-containing-pictures}}
\end{document}