EasyManua.ls Logo

Epson TM-T88V-i

Epson TM-T88V-i
258 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
56
Reception of Print Result
The print result can be received by setting a callback function using the onreceive property (p. 148) of the
ePOS-Print Canvas API object. The following information is obtained:
Printresult
Errorcode
PrinterStatus
Refer to the following program. For the details about how to program a callback function in detail, refer to
Error handling (p.50).
Theprinterstatuscanbeobtainedwhencommunicationwiththeprinterispossible.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>TITLE</title>
<script type="text/javascript" src="epos-print-3.x.x.js"></script>
<script type="text/javascript">
function drawCanvas() {
// Rendering in HTML5 Canvas
//<Obtain the context>
var canvas = document.getElementById('myCanvas');
var context = canvas.getContext('2d');
.
.
.
//Set the end point address
var address = 'http://192.168.192.168/cgi-bin/epos/
service.cgi?devid=local_printer&timeout=10000';
//Create an ePOS-Print Canvas API object
var epos = new epson.CanvasPrint(address);
//Set a response receipt callback function
epos.onreceive = function (res) {
//When the printing is not successful, display a message
if (!res.success) {
alert('A print error occurred');
}
}
//Print
epos.cut = true;
epos.print(canvas);
}
</script>
</head>
<body>
<button onclick="drawCanvas()">Run</button>
<canvas id="myCanvas" width="512" height="480"></canvas>
<img id="coffee" src="img/coffee.jpg" alt="">
<img id="wmark" src="img/wmark.png" alt="">
</body>
</html>
Print result receipt
callback function

Table of Contents

Other manuals for Epson TM-T88V-i

Related product manuals