44
Print Document Creation
A print document is created using an ePOS-Print Builder object.
Create an ePOS-Print Builder object using the constructor for it; create a print document using the object's
methods; and then acquire that print document using the toString method. For details, refer to
Refer to the following program for print document creation.
<!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 buildMessage() {
//Create an ePOS-Print Builder object
var builder = new epson.ePOSBuilder();
//Create a print document
builder.addTextLang('en')
builder.addTextSmooth(true);
builder.addTextFont(builder.FONT_A);
builder.addTextSize(3, 3);
builder.addText('Hello,\tWorld!\n');
builder.addCut(builder.CUT_FEED);
//Acquire the print document
var request = builder.toString();
alert(request);
}
</script>
</head>
<body>
<button onclick=”buildMessage()”>Run</button>
</body>
</html>
Create a print document
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 ...