0

I have generated a QRCode using this Jquery Library.

$('#myid_info_barcode').qrcode();

The code above generates a qrcode canvas in myid_infor_barcode.

<div id="myid_info_barcode" class="myid_print_duo_barcode">
   <canvas width="256" height="256"></canvas>
</div>

enter image description here

When I printed it using window.print() and media print css using the CSS code below, the QR Code disappears in the print Preview.

@media print {
    .myid_print_duo_barcode
    {       
        margin: auto; 
        border: 1px solid black;   
    }
    .myid_print_duo_barcode > canvas{
        width: 98px !important;
        height: 100px !important;  
        border: 1px solid red; 
    }    
}

Where am I missing?

enter image description here

alyssaeliyah
  • 2,214
  • 6
  • 33
  • 80
  • 1
    Does it print with the render in `table` option? A quick search shows other people having problems printing `canvas`, eg: http://stackoverflow.com/questions/5217377/print-out-of-a-html5-canvas – freedomn-m Jun 17 '15 at 09:19
  • Aren't you supposed to be all knowing? -_^ – odedta Jun 17 '15 at 09:19
  • 1
    you will need to convert the canvas into an image using toDataUrl() – Lau Jun 17 '15 at 09:20

0 Answers0