Whing Dela Cruz
asked on
html print
Hi experts, I'm trying to develop some codes that can call and print automatically to local printer (EPSON TM-U220 Receipt). Is this possible? I'm using google chrome and the codes below is printing but not directly. Any help please!
<html>
<head>
<body>
<button onclick="printData()">Print</button>
<script>
function printData()
{
var d = "June 12, 2017";
var a = "My first line";
var b = "My second line";
myWindow=window.open('','','width=200,height=100');
myWindow.document.write(d);
myWindow.document.write(a);
myWindow.document.write(b);
//myWindow.focus();
myWindow.print();
//EPSON TM-U220 Receipt
}
</script>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER