46
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.
This
section
describes
how
to
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
.
<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>
To create a print document for the image file “logo.bmp”
Summary of Contents for TM-T88V-i
Page 10: ...10 ...
Page 14: ...14 ePOS Print Canvas API Monochrome or Grayscale Monochrome ...
Page 160: ...160 ...
Page 258: ...258 ...