Transmission of Print Document
A print document is sent using an ePOS-Print object.
Create an ePOS-Print object using the constructor and specify the end point address for the printer to be
used for printing as well as the print document into the send method to send the document.
For the details about the printer end point address, refer to
Refer to the following program.
<!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 a print document
var builder = new epson.ePOSBuilder();
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);
var request = builder.toString();
//Set the end point address
var address = 'http://192.168.192.168/cgi-bin/epos/
//Create an ePOS-Print object
var epos = new epson.ePOSPrint(address);
//Send the print document
epos.send(request);
}
</script>
</head>
<body>
<button onclick="buildMessage()">Run</button>
</body>
</html>
Printer End Point Address
Specify the printer end point address in the following format:
http://[domain]/cgi-bin/epos/service.cgi?devid=[device ID]&timeout=[timeout time]
Items to specify
Domain
Device ID
Timeout period
48
service.cgi?devid=local_printer&timeout=10000';
Specify IP address or domain of ePOS-Print supported TM printer.
Specifies the printer to be used for printing.
Specify device ID registered with EpsonNet Config (Web version) of ePOS-Print
supported TM printer or TMNet WebConfig of TM intelligent printer.
Specifies the time to abort the process in milliseconds.
The timeout parameter is optional; when it is omitted, 60 seconds (60000) is set.
When the timeout period elapses, the print job is canceled; the data already
interpreted by the printer before the start of the print abort process is printed.
Printer End Point Address
(p.48).
Transmission of print document
Description