I m trying to print my php/HTML code to print in thermal print size of width 7cm max by onclick print fuction.
However it gives me A4 size print.
Later I tried googling and applied this function as :
<script type="text/javascript">
function CallPrint(printMe) {
var prtContent = document.getElementById(printMe);
var WinPrint = window.open('', '', 'left=0,top=0,width=600,height=400,toolbar=1,scrollbars=1,status=0');
WinPrint.document.write('<html><head><title></title></head>');
WinPrint.document.write('<body style="font-family:verdana; font-size:14px;width:300px;height:200px:" >');
WinPrint.document.write(prtContent.innerHTML);
WinPrint.document.write('</body></html>');
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
WinPrint.close();
prtContent.innerHTML = "";
}
</script>
</head>
but this does the resizing of printable content in an A4 sheet. which doesn't solve my problem.
so , i m here seeking help to "Print my div content in a thermal printer using onclick function"
Any help is appreciated..