I am trying to print a generated barcode. I am using the JSBarcode library to generate the barcode.
On the print screen, visuality is good but when I print it, the result is 4 pages and just one page has the barcode, and the barcode is very little and at the bottom of the page.
My html code is:
<div class="col-12 col-print-12">
<p class="barcode tekli">
<svg id="barcode tekli"></svg>
</p>
</div>
My JS code is:
JsBarcode("#barcode", "1554466", {
width:5,
height:200,
fontSize:50,
displayValue: true
});
window.print();
window.open('', '_parent', '');
window.close();
My CSS is:
@media print {
.tekli{
-webkit-transform: scaleX(2);
-o-transform: scaleX(2);
-ms-transform: scaleX(2);
transform: scaleX(2);
}
.page {
width: 21cm;
height: 29.7cm;
margin: 0;
border: initial;
border-radius: initial;
width: initial;
min-height: initial;
box-shadow: initial;
background: initial;
page-break-after: always;
}
.col-print-12 {
width: 100%;
}
}
Can you help me please?