How to print QR code in Yii2?
<p>I want to print QR code image with this source:</p>

<pre><code>&lt;img class="qrCode" src="&lt;?=Url::to(['site/qrcode', 'code' =&gt; $model-&gt;id])?&gt;"/&gt;
</code></pre>

<p>Controller:</p>

<pre><code>public function actionQrcode($code) {
 return QrCode::jpg($code);
}
</code></pre>

<p><a href="https://i.stack.imgur.com/EiBmR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EiBmR.png" alt="enter image description here"></a></p>

<p>but in print page, image dose't show.</p>

<p><a href="https://i.stack.imgur.com/xbpF4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xbpF4.png" alt="enter image description here"></a></p>

<p>Js code:</p>

<pre><code>        function printDiv(el) {
            var restorepage = document.body.innerHTML;
            var printcontent = document.getElementById(el).innerHTML;
            document.body.innerHTML = printcontent;
            window.print();
            document.body.innerHTML = restorepage;
        }
</code></pre>