Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

419
Vistas
QR CODE not showing when printing JavaScript

I have a Qr code which i want to print. Qr code is showing fine in the page but when i try to print it it's not showing.

in home page - enter image description here

in print page -

enter image description here

Html

<div class="container" id="printarea">
        <div class="card"style="height: 386px;">
          <div class="card-body">
            <center>
             <div id="qrcode"></div>
             <br>
              <br>
              <br>
              <br>
              <br>
              <br>
              <br>
            Powered by <img src="{{env('APP_URL')}}/public/{{$app_setting->webLogo}}" class="logo-icon" alt="logo icon" style="width:40px;">
            </center>
          </div>
        </div>
      </div>

JQuery Qr Code

<script>
 var qrcode1 = "{{Auth::guard('vendor')->user()->VendorURL}}";
 jQuery(function(){
    jQuery('#qrcode').qrcode(qrcode1);
 })
</script>

Qr code printing code

function printFunc() {
var divToPrint = document.getElementById('printarea');
var htmlToPrint = '' +
    '<style type="text/css">' +
    'table th, table td {' +
    'border:1px solid #000;' +
    'padding;0.5em;' +
    '}' +
    '</style>';
htmlToPrint += divToPrint.innerHTML;
newWin = window.open("");
newWin.document.write("<h3 align='center'>QR Code</h3>");
newWin.document.write(htmlToPrint);
newWin.print();
newWin.close();
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

I have get this Solution - Converting the QR Code to an Image

var canvas = $('#qrcode canvas');
var img = canvas.get(0).toDataURL("image/png");
newWin = window.open("");
var ig = '<p style="text-align: center;">Powered by <img src="{{env('APP_URL')}}/public/{{$app_setting->webLogo}}" class="logo-icon" alt="logo icon" style="width:40px;"></p>';
newWin.document.write("<h3 align='center'>QR Code</h3>");
newWin.document.write('<img style="display: block; margin: 0 auto;" src="'+img+'"/>');
newWin.document.write(ig);
setTimeout(function() {
newWin.print();
newWin.close();
}, 250);
}
about 4 years ago · Juan Pablo Isaza Denunciar

0

Just Enable Background Graphics from print preview page, Click on more settings you can see it

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda