Epson TM-T88V-i User Manual page 46

Epos-print api
Hide thumbs Also See for TM-T88V-i:
Table of Contents

Advertisement

To create a graphic print document:
To create a graphic print document, store a raster image obtained by rendering an image in HTML5
Canvas into the command buffer using the addImage method. Refer to the following program.
To create a print document for the image file "logo.bmp"
<script type="text/javascript" src="epos-print-3.x.x.js"></script>
<script type="text/javascript">
function buildMessage() {
//Create an ePOS-Print Builder object
var builder = new epson.ePOSBuilder();
//Render an image in HTML5 Canvas
var canvas = document.getElementById('canvas');
var context = canvas.getContext('2d');
context.drawImage(document.getElementById('logo'), 0, 0, 200, 70);
//Create a print document
builder.addTextAlign(builder.ALIGN_CENTER);
builder.addImage(context, 0, 0, canvas.width, canvas.height, builder.COLOR_1);
builder.addCut(builder.CUT_FEED);
//Acquire the print document
var request = builder.toString();
}
</script>
This section describes how to print a raster image. In addition, there is also a method of printing 
graphics registered in the NV memory of the printer. For details, refer to addLogo method (p.89).
46

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tm-t70-iTm-l90-i

Table of Contents