Epson TM-T88V-i User Manual

Epson TM-T88V-i User Manual

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

Advertisement

ePOS-Print API
User's Manual
Overview
Describes the features and development environment.

Sample Program

Describes how to use the sample program and how to 
build a system.
Programming Guide
Describes how to write programs in Web application 
development.
ePOS-Print API
Describes the ePOS‐Print API.
ePOS-Print Canvas API
Describes the ePOS‐Print CanvasAPI.
ePOS-Print Editor
Describes the ePOS‐Print Editor.
Appendix
Describes the specifications for printers used for ePOS‐Print, how to 
use the rendering of images in HTML5 Canvas.
M00042109
Rev.J

Advertisement

Table of Contents
loading

Summary of Contents for Epson TM-T88V-i

  • Page 1: Sample Program

    ePOS-Print API User’s Manual Overview Describes the features and development environment. Sample Program Describes how to use the sample program and how to  build a system. Programming Guide Describes how to write programs in Web application  development. ePOS-Print API Describes the ePOS‐Print API. ePOS-Print Canvas API Describes the ePOS‐Print CanvasAPI. ePOS-Print Editor Describes the ePOS‐Print Editor. Appendix Describes the specifications for printers used for ePOS‐Print, how to  use the rendering of images in HTML5 Canvas. M00042109 Rev.J...
  • Page 2 • Neither is any liability assumed for damages resulting from the use of the information contained herein. • Neither Seiko Epson Corporation nor its affiliates shall be liable to the purchaser of this product or third parties for damages, losses, costs, or expenses incurred by the purchaser or third parties as a result of: accident, misuse, or abuse of this product or unauthorized modifications, repairs, or alterations to this product, or (excluding the U.S.) failure to strictly comply with Seiko Epson Corporation’s operating...
  • Page 3: For Safety

    For Safety Key to Symbols The symbols in this manual are identified by their level of importance, as defined below. Read the following carefully before handling the product. Provides information that must be observed to avoid damage to your equipment or a malfunction.
  • Page 4: About This Manual

    In this manual, "ePOS-Print supported printer" is a generic term for the TM-i series and TM printers that support the ePOS-Print API. The TM-i series in this manual is a generic term for the following printers.  TM-T88V-i  TM-T70-i  TM-L90-i...
  • Page 5: Table Of Contents

    Contents ■ For Safety..........................3 Key to Symbols ............................3 ■ Restriction of Use ........................3 ■ About this Manual ........................4 Aim of the Manual..........................4 Manual Content ............................ 4 ■ Contents ..........................5 Overview ..................11 ■ Overview of ePOS-Print ......................11 Features ..............................12 Print Example............................
  • Page 6 Prints an Canvas image........................55 Reception of Print Result........................56 Reception of Status Event ........................58 ePOS-Print API ................59 ■ List of API functions......................59 window.epson.ePOSBuilder Components..................59 window.epson.ePOSPrint Components .....................63 ■ ePOS-Print Builder Object....................65 Constructor ............................65 addTextAlign method ..........................66 addTextLineSpace method ........................67 addTextRotate method ........................68 addText method...........................69...
  • Page 7 addSymbol method ..........................95 addHLine method ..........................101 addVLineBegin method ........................103 addVLineEnd method........................105 addPageBegin method........................107 addPageEnd method........................108 addPageArea method ........................109 addPageDirection method......................111 addPagePosition method ........................ 113 addPageLine method ........................115 addPageRectangle method ......................117 addCut method ..........................
  • Page 8 Canvas API ..............161 ■ List of ePOS-Print Canvas API functions................161 window.epson.CanvasPrint Components ..................161 ■ ePOS-Print Canvas API Object..................164 Constructor ............................164 print method ............................165 open method .............................167 close method............................168 recover method ..........................169 reset method ............................169 address property ..........................170 enabled property..........................171...
  • Page 9 ■ Setting ..........................203 ■ Creating a Sample Code ....................204 Print..............................207 Import..............................208 Appendix..................209 ■ Printer specifications ......................209 TM-T88V-i ............................. 209 TM-T88V ............................... 211 TM-T88IV .............................. 213 TM-T70-i..............................215 TM-T70-i (Multi-language model) ..................... 217 TM-T70..............................219 TM-T70 (Multi-language model) ....................... 221 TM-L90-i ...............................
  • Page 11: Overview

    Chapter 1 Overview Overview This chapter describes the features of and the specifications for ePOS-Print. Overview of ePOS-Print ePOS-Print is functionality to control POS printers in a multi-platform environment. From Web browser of computer, smart phone and tablet, printing can be directly done on ePOS-Print supported TM printer. In addition, print images rendered in HTML5 Canvas can be printed.
  • Page 12: Features

    Features ❏ As long as it is in a network environment, a terminal with an HTML5-supported Web browser can perform printing from anywhere. ❏ It supports Windows store apps (JavaScript). ❏ Installation of drivers and plug-ins is not required. ❏ No PCs or servers are required for printing. ❏...
  • Page 13: Print Example

    Chapter 1 Overview Print Example ePOS-Print API Printing a Logo Alignment: Center Paper Feed Paper Feed and Paper Cut Printing a raster image Your Number: Printing text in the double-sized width style Scale: x 6 (horizontal) and x 4 (vertical) Alignment: Center Printing a Barcode...
  • Page 14 ePOS-Print Canvas API Monochrome or Grayscale Monochrome...
  • Page 15: Print Flow

    Chapter 1 Overview Print Flow <Web Server> <Printers that can be controlled> Application Wireless LAN / Router <Web Browser> Wireless " Device Control Network <ePOS-Print supported TM printer> A Web application is placed. A Web browser displays the Web application. The Web browser sends print data....
  • Page 16: Features

    Features The installed functions vary depending on the model. For details, refer to Appendix, Printer  Specifications.  Printing functions of ePOS-Print API ❏ Print setting (alignment/line feed space/text rotation/page mode) ❏ Character data setting (language/font (device font)/double-sizing/scale/smoothing/print position) ❏ Character style setting (inversion of black and white/underline/bold) ❏ Paper feed setting (in dots/in lines) ❏...
  • Page 17: Operating Environment

     Standard browser in Android 2.2 or later ❏ Windows Store apps  JavaScript project Terminal Terminal with an HTML5-supported Web browser ePOS-Print Supported TM printer TM-i Series ❏ TM-T88V-i ❏ TM-T70-i ❏ TM-L90-i TM Printer ❏ TM-P60II ❏ TM-P60II with Peeler ❏ TM-P80 Unable to control other TM printer...
  • Page 18: System Construction Example

    System Construction Example Registering a Web Application Into the Web Server <Web Server> <Printers That Can Be Controlled> Application Wireless LAN / Router <Terminal> Web Browser " Wireless Device Control Network <TM-i> ❏ Web Server A Web application is placed. ❏...
  • Page 19: Registering A Web Application Into A Tm-I

    Chapter 1 Overview Registering a Web Application Into a TM-i Wireless LAN / Router <Terminal> Web Browser Wireless Application Device Control <TM-i> Network ❏ Terminal Executes the Web application using a browser. ❏ TM-i Mounts the Web application. Creates and prints the print data using transmission with the input terminal's Web browser.
  • Page 20: Registering A Web Application To A Cloud

    Registering a Web application to a cloud <Web Server> Application Wireless LAN / Router <Terminal> Web Browser <TM Printer> (Wireless LAN Model) Wireless Device Control Network ❏ Terminal Executes the Web application using a browser. ❏ TM Printer (Wireless LAN Model)
  • Page 21: Contents In The Package

    Contents in the Package Manual ❏ ePOS-Print API User’s Manual (This Document) ❏ ePOS-Print XML User’s Manual ❏ TM-T88V-i Technical Reference Guide ❏ TM-T70-i Technical Reference Guide ❏ TM-L90-i Technical Reference Guide ❏ TM-P60II Technical Reference Guide ❏ TM-P80 Technical Reference Guide SampleProgram ePOS-Print_API_UM_E_Sample.zip...
  • Page 22 Utility ❏ TM-i Series Utility TM-T88V-i TM-T70-i TM-L90-i ● Model-Dedicated Utility ● Memory Switch Setting Utility TM Flash Logo Setup Utility ● ● (TMFLogo) TMNet WinConfig ● ● ● (EpsonNet Config) ❏ TM Printer (Wireless LAN Model) Utility TM-P60II TM-P80 ●...
  • Page 23: Version Information

    Version of ePOS-Print Service installed on a printer can be confirmed as follows. Model Confirmation Method ePOS-Print Version <TM-i Series> <Example>  TM-T88V-i  Displayed on EPSON TMNet WebConfig 2.0xWW: Ver.2.0  TM-T70-i  Printed on the status sheet 2.1xWW: Ver.2.1  TM-L90-i <TM Printer (Wireless LAN Model)>...
  • Page 24: Restrictsions

    Restrictsions ❏ The drawer and the buzzer cannot be used together. ❏ The buzzer function cannot be used if the printer is not provided with the buzzer. ❏ Internet Explorer 9 does not allow printing to the printer to be performed from security-protected Web pages (HTTPS).
  • Page 25: Sample Program

    Chapter 2 Sample Program Sample Program This chapter describes how to use the sample program. • In this chapter, descriptions are made based on a system configuration using a Web server. • Descriptions are made assuming that the Web server in this chapter is a Web server configured  by using IIS (Microsoft Internet Information Services). If your Web server is used in a different  environment, interpret the descriptions accordingly. Sample Program System Overview Sample Program Screen The screen compositions for the sample program are as follows: Item Description Prints queue ticket numbers.
  • Page 26 Item Description Displays the "Settings" screen. The screen is used to set the following:  IP adress of the ePOS-Print supported TM printer (Default :  TM-i: DHCP (If an address fails to be assigned via DHCP , the value becomes "192.168.192.168".) ...
  • Page 27: Print Image

    Chapter 2 Sample Program Print Image The sample program prints the following: Your Number Coupon (ePOS-Print API) (ePOS-Print Canvas API) Your Number: Label* (ePOS-Print API) Item A Name Color Code *2012001* *:Die cut label: mount width 58mm or above Label size: width 54 mm x height 25.4 mm or above...
  • Page 28: Program Flow

    Program Flow From its initial display state up to print job completion, the sample program flows as below. Queue ticket number issuance (ePOS-Print API) 1. Open the sample program Web page 2. Settings ❏ Settings of IP address of ePOS-Print supported TM printer ❏...
  • Page 29 Chapter 2 Sample Program Coupon issuance (ePOS-Print Canvas API) 1. Open the sample program Web page 2. Settings ❏ Settings of IP address of ePOS-Print supported TM printer ❏ Device ID of the printer to be used for printing ❏ Print timeout time 3.
  • Page 30 Label issuance (ePOS-Print API) 1. Open the sample program Web page 2. Settings ❏ Settings of IP address of ePOS-Print supported TM printer ❏ Device ID of the printer to be controlled ❏ Print timeout time ❏ Settings of with or without layout specification in label printing of TM-P60II 3.
  • Page 31: Operating Environment

    Chapter 2 Sample Program Operating Environment TM-i The system configuration diagram for the sample programs is as below. • The figure below also describes an example of IP address settings as network settings. • In the sample program, ʺPrinter to be controlledʺ is not required. Refer to it if necessary. Wireless Web Server Computer to configure the settings Network [192.168.192.10] Printer to be controlled [192.168.192.21] Terminal [192.168.192.XXX] Wireless LAN Router [192.168.192.1] :When DHCP is used for the terminal TM-i...
  • Page 32: Tm Printer (Wireless Lan Model)

    TM Printer (Wireless LAN Model) The system configuration diagram for the sample programs is as below. • The figure below also describes an example of IP address settings as network settings. Web Server Wireless Computer to configure the settings [192.168.192.10] Network Printer to be controlled [192.168.192.21] Wireless LAN Router [192.168.192.1] Terminal TM-P60II [192.168.192.XXX] <TM Printer(Wireless LAN Model)>...
  • Page 33: Environment Settings

    Chapter 2 Sample Program Environment Settings A flow for configuring the environment settings for the sample program is shown as follows: 1. Router Settings Configure the settings such as SSID, IP address, DHCP , and allocated IP address. For details, refer to the manual for the device you are using. 2.
  • Page 34: Registration Of Sample Program (Epos-Print_Api_Um_E_Sample.zip)

    Device ID Settings (p.37) Configuration is done from a Web browser(these settings are not required in this sample program). Sample Program Settings (p.39) Configuration is done from a Web browser(these settings are not required in this sample program). Registration of Sample Program (ePOS-Print_API_UM_E_Sample.zip) Register the sample program into the Web server.
  • Page 35: Network Setting Of Epos-Print Supported Tm Printer

    Chapter 2 Sample Program Network Setting of ePOS-Print Supported TM printer ❏ TM-i ❏ TM Printer for Wireless LAN Model TM-i Use TMNet WebConfig to configure the network settings such as IP address for the printer. Configure the settings according to the following procedure: Connect the printer to the network and turn the power ON.
  • Page 36 TM Printer for Wireless LAN Model Connect the printer to a PC via the USB cable. Turn on the printer. Start up EpsonNet Config. Double-click on the printer. Configure the [Network] settings and the [TCP/IP] settings. Disconnect the USB cable, turn off the printer, and then turn it back on.
  • Page 37: Device Id Settings

    Chapter 2 Sample Program Device ID Settings ❏ TM-i ❏ TM Printer for Wireless LAN Model TM-i Set the Device ID of the printer to be controlled by ePOS-Print into the TM-i. Use TMNet WebConfig to set the Device ID. In the sample program, ʺDevice ID Settingsʺ are not required. Refer to it if necessary.
  • Page 38 The "Device Settings" screen appears. Set the following and click [Register]. Item Description Device ID Specifies the ID to identify the printer to be controlled by ePOS-Print. Model Specifies the model of the printer to be controlled. IP Address Specifies the IP address of the printer to be controlled. Retry Interval (ms) Specifies the interval of retry toward the printer to be controlled, in milliseconds.
  • Page 39: Sample Program Settings

    Chapter 2 Sample Program Sample Program Settings Configure the settings for the sample program according to the procedure below. In the sample program, ʺDevice ID Settingsʺ are not required. Refer to it if necessary. Start the Web server. Connect all the printers to the network and turn their power ON. Open the following URL page using the Web browser. http://Web server IP address/sample/index.html The sample program page opens.
  • Page 40 The “Settings” screen appears. Specify the following and click [OK]. Item Description Specifies the IP address of the ePOS-Print supported TM printer.  (Default value:  TM-i: DHCP IP address of the intelligent printer (If an address fails to be assigned via DHCP , the value becomes "192.168.192.168".) ...
  • Page 41: Programming Guide

    Chapter 3 Programming Guide Programming Guide This chapter describes how to write programs in the application development using ePOS-Print. ePOS-Print API Print Mode There are two types of print modes: standard and page modes. Standard mode In standard mode, characters are printed line by line. The line feed space is adjusted based on the font size and the height of images, barcodes, etc.
  • Page 42: Programming Flow

    Programming Flow For the ePOS-Print API, programming is performed based on the following work flow: Embedding of ePOS-Print API (p.43) Print Document Creation (p.44) ❏ To create a text print document: (p.45) ❏ To create a graphic print document: (p.46) ❏...
  • Page 43: Embedding Of Epos-Print Api

    Embed the script into the Web page by using the HTML <script> tags. <!DOCTYPE html> <html> <head> Embed <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() { var builder = new epson.ePOSBuilder(); </script> </head> <body> </body> </html>...
  • Page 44: 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); Create a print document builder.addTextSize(3, 3); builder.addText('Hello,\tWorld!\n'); builder.addCut(builder.CUT_FEED);...
  • Page 45 4 (horizontal) and x 4 (vertical) ❏ Style: Bold <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 //<Configure the print character settings> builder.addTextLang('en'); builder.addTextSmooth(true); builder.addTextFont(builder.FONT_A); builder.addTextSize(4, 4);...
  • Page 46 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);...
  • Page 47 For the string "Hello World!", to create a print document based on the following settings: <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 //<The page mode starts> builder.addPageBegin(); //<Specify the page mode print area>...
  • Page 48: Transmission Of Print Document

    <!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'); Transmission of print document builder.addCut(builder.CUT_FEED); var request = builder.toString();...
  • Page 49: Reception Of Print Result

    <!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(); var address = 'http://192.168.192.168/cgi-bin/epos/ service.cgi?devid=local_printer&timeout=10000';...
  • Page 50: Error Handling

    Error handling Refer to the following program for the error handling method by a callback function. //Create an ePOS-Print object var epos = new epson.ePOSPrint(address); // Set a response receipt callback function epos.onreceive = function (res) { // Obtain the print result and error code ' + res.code ...
  • Page 51: Reception Of Status Event

    //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 Builder object var builder = new epson.ePOSBuilder(address); //Set an event callback function (cover open) epos.oncoveropen = function () { alert('coveropen'); //Set an event callback function (paper near end) epos.onpapernearend = function () {...
  • Page 52: Epos-Print Canvas Api

    ePOS-Print Canvas API For the ePOS-Print Canvas API, programming is performed based on the following work flow: Embedding of ePOS-Print Canvas API (p.53) Rendering in HTML5 Canvas (p.54) Prints an Canvas image (p.55) Reception of Print Result (p.56) • ePOS‐Print supported TM printer starts printing after checking the status of TM printer. •...
  • Page 53: Embedding Of Epos-Print Canvas Api

    Chapter 3 Programming Guide Embedding of ePOS-Print Canvas API The ePOS-Print Canvas API is provided as JavaScript. And its file name is "epos-print-3.x.x.js". It is used by embedding epos-print-3.x.x.js into applications. Preparation To use the ePOS-Print Canvas API, place epos-print-3.x.x.js on the Web server. Embedding into Web pages Embed the script into the Web page by using the HTML <script>...
  • Page 54: Rendering In Html5 Canvas

    Rendering in HTML5 Canvas Render an image in HTML5 Canvas. <!DOCTYPE html> <html> <head> Rendering in HTML5 Canvas <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');...
  • Page 55: Prints An Canvas Image

    = document.getElementById('myCanvas'); var context = canvas.getContext('2d'); Transmission of print document //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); //Print epos.cut = true; epos.print(canvas); </script> </head> <body>...
  • Page 56: Reception Of Print Result

    //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) {...
  • Page 57 Chapter 3 Programming Guide Error handling Refer to the following program for the error handling method by a callback function. var epos = new epson.CanvasPrint(address); // Set a response receipt callback function epos.onreceive = function (res) { // Obtain the print result and error code var msg = ''Print ' + (res.success ? 'Success' : 'Failure') + '\n...
  • Page 58: Reception Of Status Event

    //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 an event callback function (cover open) epos.oncoveropen = function () { alert('coveropen'); //Set an event callback function (paper near end) epos.onpapernearend = function () {...
  • Page 59: Epos-Print Api

    Chapter 4 ePOS-Print API ePOS-Print API This chapter describes the ePOS-Print API. List of API functions ePOS-Print provides the following objects: ❏ ePOS-Print Builder (window.epson.ePOSBuilder) Object ❏ ePOS-Print (window.epson.ePOSPrint) Object window.epson.ePOSBuilder Components Stan- Elem- page Description dard mode mode Constructor Initializes an ePOS-Print XML Builder ●...
  • Page 60 Stan- Elem- page Description dard mode mode Method Adds a tag for paper feeding (in ● ● addFeedUnit dots). Adds a tag for paper feeding (in ● ● addFeedLine lines). Paper Feed Adds control of label paper/black ● addFeedPosition mark paper to command buffer Adds a line feed to the command ●...
  • Page 61 Chapter 4 ePOS-Print API Stan- Elem- page Description dard mode mode Method ● Buzzer addSound Adds a tag for turning on the buzzer. Adds the paper layout setup to command buffer  ● Layout addLayout (in firmware Ver.2.2 and later) Recov- Adds a tag for recovering from an ●...
  • Page 62 Element Description Page Property Raster image halftone processing method halftone (in firmware Ver.1.2 and later) Raster image brightness correction value brightness (in firmware Ver.1.2 and later) Forced transmission mode force (in firmware Ver.3.0 and later) message Message buffer Constant FONT_* font ALIGN_* alignment...
  • Page 63: Window.epson.eposprint Components

    Chapter 4 ePOS-Print API window.epson.ePOSPrint Components Element Description Page Constructor ePOS-Print Initializes an ePOS-Print object Method send Sends a message Enables status event operation open (in firmware Ver.1.2 and later) Disables status event operation close (in firmware Ver.1.2 and later) Property URL of the printer ...
  • Page 64 Element Description Page Event Drawer close event  ondrawerclosed (in firmware Ver.1.2 and later) Drawer open event  ondraweropen (in firmware Ver.1.2 and later) Battery OK event  onbatteryok (in firmware Ver.2.2 and later) Battery low event  onbatterylow (in firmware Ver.2.2 and later) Constant ASB_* Status...
  • Page 65: Epos-Print Builder Object

    This objects creates a print document for printer control commands that specify strings or graphics to be printed, paper cut, etc. Constructor Constructor for an ePOS-Print Builder object. Creates a new ePOS-Print Builder object and initializes it. Syntax ePOSBuilder(); Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); //--> </script>...
  • Page 66: Addtextalign Method

    Builder Object ePOS Builder Exception Exception Object type Parameter " ... " is invalid Error Example To set alignment to the center: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addTextAlign(builder.ALIGN_CENTER); //--> </script>...
  • Page 67: Addtextlinespace Method

    Builder Exception Exception Object type Parameter " ... " is invalid Error Example To set the line feed space to 30 dots: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addTextLineSpace(30); //--> </script>...
  • Page 68: Addtextrotate Method

    Object type ePOS-Print Builder Object ePOS Builder Exception Exception Object type Parameter " ... " is invalid Error Example To set text rotation: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addTextRotate(true); //--> </script>...
  • Page 69: Addtext Method

    Object type ePOS-Print Builder Object ePOS Builder Exception Exception Object type Parameter " ... " is invalid Error Example To add character strings: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addText('Hello,\t').addText('World\n'); //--> </script>...
  • Page 70: Addtextlang Method

    addTextLang method Adds the language setting to the command buffer. Syntax addTextLang(lang); Parameter  lang : ( Required parameter, Object type : String) Specifies the target language. Setting Language en(default) English(ANK) German (ANK) French (ANK) Italian (ANK) Spanish (ANK) Japanese (International character set changes to Japan.) Japanese ja-jp (International character set changes to Japan.) Korean...
  • Page 71 Parameter " ... " is invalid Error Example To set the language as English: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addTextLang('en'); //--> </script> To set the language as Korean: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder();...
  • Page 72 To set the language as Simplified Chinese: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addTextLang('zh-hans'); //--> </script> To set the language as Traditional Chinese: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder();...
  • Page 73: Addtextfont Method

    Object type ePOS-Print Builder Object ePOS Builder Exception Exception Object type Parameter " ... " is invalid Error Example To set the font B: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addTextFont(builder.FONT_B); //--> </script>...
  • Page 74: Addtextsmooth Method

    Return value Object type ePOS-Print Builder Object ePOS Builder Exception Exception Object type Parameter " ... " is invalid Error Example To enable smoothing: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addTextSmooth(true); //--> </script>...
  • Page 75: Addtextdouble Method

    Chapter 4 ePOS-Print API addTextDouble method Adds the double-sized text setting to the command buffer. Syntax addTextDouble(dw, dh); Parameter  dw : ( Optional parameter, Object type : Boolean) Specifies the double‐sized width. Setting Description true or 1 Specifies the double-sized width. false or 0 (default) Cancels the double-sized width undefined Retains the current setting for double-sized width.
  • Page 76 Example To set the size as double width and height: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addTextDouble(true, true); //--> </script>...
  • Page 77: Addtextsize Method

    Parameter " ... " is invalid Error Example To set a horizontal scale of x 4 and a vertical scale of x 4: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addTextSize(4, 4); //--> </script>...
  • Page 78: Addtextstyle Method

    addTextStyle method Adds the text style setting to the command buffer. Syntax addTextStyle(reverse, ul, em, color); Parameter  reverse : (  Optional parameter, Object type : Boolean) Specifies inversion of black and white for text. Setting Description Specifies the inversion of black and white parts true or 1 of characters. Cancels the inversion of black and white parts false or 0 (default) of characters.
  • Page 79 Builder Object ePOS Builder Exception Exception Object type Parameter " ... " is invalid Error Example To set the underline style: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addTextStyle(undefined, true); //--> </script>...
  • Page 80: Addtextposition Method

    Exception Object type Parameter " ... " is invalid Error Example To set the print position at 120 dots from the left end: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addTextPosition(120); //--> </script>...
  • Page 81: Addtextvposition Method

    Object type Parameter " ... " is invalid Error Example To set the print position at 120 dots from the top: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addPageBegin(); builder.addTextVPosition(120); builder.addPageEnd(); //--> </script>...
  • Page 82: Addfeedunit Method

    Builder Object ePOS Builder Exception Exception Object type Parameter " ... " is invalid Error Example To feed paper by 30 dots: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addFeedUnit(30); //--> </script>...
  • Page 83: Addfeedline Method

    Builder Object ePOS Builder Exception Exception Object type Parameter " ... " is invalid Error Example To feed paper by 3 lines: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addFeedLine(3); //--> </script>...
  • Page 84: Addfeedposition Method

    addFeedPosition method Adds label/black mark paper feeding to the command buffer. (Supported in firmware Ver.2.1 and later) • Control of label paper/black mark paper must be done in the standard mode. • In the page mode, addFeedPosition method specification cannot be used. Syntax addFeedPosition(pos); Parameter  pos : ( Required parameter, Object type : String) Specifies the feed position. Setting Description FEED_PEELING Feeds to the peeling position. FEED_CUTTING Feeds to the cutting position. FEED_CURRENT_TOF Feeds to the top of the current label.
  • Page 85 Chapter 4 ePOS-Print API Example To print while peeling the label one by one <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addFeedPosition(builder.FEED_CURRENT_TOF); builder.addBarcode('0001', builder.BARCODE_CODE39, builder.HRI_BELOW); builder.addFeedPosition(builder.FEED_PEELING); //--> </script> To print labels consecutively <script type="text/javascript" src="epos-print-3.x.x.js"></script>...
  • Page 86: Addfeed Method

    Return value Return value Object type ePOS-Print Builder Object ePOS Builder Example To start a new line after printing a character string: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addText(“Hello”).addFeed(); builder.addText(“World”).addFeed(); //--> </script>...
  • Page 87: Addimage Method

    Chapter 4 ePOS-Print API addImage method Adds raster image printing to the command buffer. Prints graphics rendered in HTML5 Canvas. Converts the specified range in a RGBA full-color image of HTML5 Canvas into raster image data according to the settings of the halftone and brightness properties. One pixel in an image equals to one printer dot. When an image contains any transparent color, the background color of the image is assumed to be white.
  • Page 88 Parameter " ... " is invalid Error Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); var canvas = document.getElementById('canvas'); if (canvas.getContext) { var context = canvas.getContext('2d'); builder.addImage(context, 0, 0, canvas.width, canvas.height); //--> </script>...
  • Page 89: Addlogo Method

    Return value Return value Object type ePOS-Print Builder Object ePOS Builder Exception Exception Object type Parameter " ... " is invalid Error Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addLogo(48, 48); //--> </script>...
  • Page 90: Addbarcode Method

    addBarcode method Adds barcode printing to the command buffer. In page mode, a barcode is laid out in the current print position with the reference point being its  bottom left dot (except for HRI). Syntax addBarcode(data, type, hri, font, width, height); Parameter  data : ( Required parameter, Object type : String) Specifies the barcode data as a string. Barcode type Description When an 11-digit number is specified, a check digit is automatically added. UPC-A When a 12-digit number is specified, the 12th digit is pro- cessed as a check digit but the check digit is not vali- dated.
  • Page 91 Chapter 4 ePOS-Print API Barcode type Description Specify a start character (A to D, a to d). CODABAR Specify a stop character (A to D, a to d). Check digits are not added or validated. Start and stop characters are automatically added. CODE93 A check digit is automatically calculated and added.
  • Page 92 Barcode type Description You can enclose an application identifier (AI) in parentheses. The parentheses are used as HRI print characters and are not encoded as data. To encode each of the following characters, specify two BARCODE_GS1_ characters starting with the character "{": DATABAR_EXPANDED FNC1: To specify binary data that cannot be represented by character strings, use the following escape ...
  • Page 93 Chapter 4 ePOS-Print API  hri : ( Optional parameter, Object type : String) Specifies the HRI position. Constant (hri) Description HRI_NONE (default) HRI not printed HRI_ABOVE Above the bar code HRI_BELOW Below the bar code HRI_BOTH Both above and below the bar code  font : ( Optional parameter, Object type : String) Specifies the HRI font. Constant (font) Language FONT_A(default) Font A...
  • Page 94 Example To print barcodes: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addBarcode('01234567890', builder.BAROCDE_UPC_A, builder.HRI_BELOW, undefined, 2, 64); builder.addBarcode('01234500005', builder.BAROCDE_UPC_E); builder.addBarcode('201234567890', builder.BAROCDE_EAN13); builder.addBarcode('201234567890', builder.BAROCDE_JAN13); builder.addBarcode('2012345', builder.BAROCDE_EAN8); builder.addBarcode('2012345', builder.BAROCDE_JAN8); builder.addBarcode('ABCDE', builder.BAROCDE_CODE39); builder.addBarcode('012345', builder.BAROCDE_ITF); builder.addBarcode('A012345A', builder.BAROCDE_CODABAR);...
  • Page 95: Addsymbol Method

    Chapter 4 ePOS-Print API addSymbol method Adds two-dimensional symbol printing to the command buffer. In page mode, a two‐dimensional symbol is laid out in the current print position with the  reference point being its bottom left dot.  Syntax addSymbol(data, type, level, width, height, size); Parameter  data : ( Required parameter, Object type : String) Specifies two‐dimensional symbol data as a character string. 2D-Code type Description Standard PDF417 Convert the character string to the string in UTF- 8, apply the escape sequence, and then encode the string.
  • Page 96 2D-Code type Description MaxiCode Mode 2 Convert the character string to the string in UTF- 8, apply the escape sequence, and then MaxiCode Mode 3 encode the string. MaxiCode Mode 4 In Modes 2 and 3, when the first piece of data is MaxiCode Mode 5 [)>\ x1e01\x1dyy (where yy is a two-digit num- ber), this is processed as the message header,...
  • Page 97 Chapter 4 ePOS-Print API To specify binary data that cannot be represented by character strings, use the following escape  sequences. String Description \xnn Control code Back slash  type : ( Required parameter, Object type : String) Specifies the two‐dimensional symbol type. Constant (type) 2D-Code type SYMBOL_PDF417_STANDARD Standard PDF417 SYMBOL_PDF417_TRUNCATED Truncated PDF417 SYMBOL_QRCODE_MODEL_1 QR Code Model 1 SYMBOL_QRCODE_MODEL_2 QR Code Model 2 SYMBOL_MAXICODE_MODE_2 MaxiCode Mode 2 SYMBOL_MAXICODE_MODE_3 MaxiCode Mode 3 SYMBOL_MAXICODE_MODE_4...
  • Page 98  level : ( Optional parameter, Object type : String) Specifies the error correction level. Constant (level) Description LEVEL_0 PDF417 error correction level 0 LEVEL_1 PDF417 error correction level 1 LEVEL_2 PDF417 error correction level 2 LEVEL_3 PDF417 error correction level 3 LEVEL_4 PDF417 error correction level 4 LEVEL_5 PDF417 error correction level 5 LEVEL_6 PDF417 error correction level 6 LEVEL_7...
  • Page 99 Chapter 4 ePOS-Print API  height : ( Optional parameter, Object type : Number) Specifies the module height. Specifies an integer from 0 to 255. 2D-Code type Valid value range Default value 2 to 8 PDF417 (Magnification for width) QR Code MaxiCode 2D GS1 Databar Ignored Aztec Code DataMatrix  size : ( Optional parameter, Object type : Number) Specifies the two‐dimensional symbol maximum size. Specifies an integer from 0 to 65535. 2D-Code type Default value Description Specifies the number of PDF417...
  • Page 100 Example To print two-dimensional symbols: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addSymbol('ABCDE', builder.SYMBOL_PDF417_STANDARD); builder.addSymbol('ABCDE', builder.SYMBOL_QRCODE_MODEL_2, builder.LEVEL_Q); builder.addSymbol('908063840\x1d850\x1d001\x1d\x04', builder.SYMBOL_MAXICODE_MODE_2); builder.addSymbol('0201234567890', builder.SYMBOL_ GS1_DATABAR_STACKED); builder.addSymbol('0201234567890', builder.SYMBOL_GS1_DATABAR_STACKED_OMNIDIRECTIONAL); builder.addSymbol('(01)02012345678903', builder.SYMBOL_GS1_DATABAR_EXPANDED_STACKED); builder.addSymbol('ABCDE', builder.SYMBOL_AZTECCODE_FULLRANGE, 23); builder.addSymbol('ABCDE', builder.SYMBOL_DATAMATRIX_SQUARE); //--> </script>...
  • Page 101: Addhline Method

    Chapter 4 ePOS-Print API addHLine method Adds horizontal line printing to the command buffer. Draws horizontal lines. Not available in page mode. Syntax addHLine(x1, x2, style); Parameter  x 1: ( Required parameter, Object type : Number) Specifies the start position of the horizontal line (in dots). Specifies an integer from 0 to 65535.  x2 : ( Required parameter, Object type : Number) Specifies the end position of the horizontal line (in dots). Specifies an integer from 0 to 65535.  style : ( Optional parameter, Object type : String) Specifies the line type. Constant (style) Description LINE_THIN Solid line: Thin LINE_MEDIUM Solid line: Medium LINE_THICK...
  • Page 102  Between 100 dots and 200 dots from the left end  Between 400 dots and 500 dots from the left end <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addHLine(100, 200, builder.LINE_THIN_DOUBLE); builder.addHLine(400, 500, builder.LINE_THIN_DOUBLE); //--> </script>...
  • Page 103: Addvlinebegin Method

    Chapter 4 ePOS-Print API addVLineBegin method Adds the beginning of vertical line to the command buffer. Starts to draw vertical lines. • Not available in page mode. • Vertical lines are drawn until their end is specified by addVLineEnd (p. 105). Use this API  function with addVLineEnd. Syntax addVLineBegin(x, style); Parameter  x : ( Required parameter, Object type : Number) Specifies the start position of the vertical line (in dots). Specifies an integer from 0 to 65535.  style : ( Optional parameter, Object type : String) Specifies the line type. Constant (style) Description LINE_THIN Solid line: Thin...
  • Page 104 Example To draw thin vertical lines at 100 dots and 200 dots from the left end: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addVLineBegin(100).addVLineBegin(200); builder.addFeedUnit(100); builder.addVLineEnd(100).addVLineEnd(200); //--> </script>...
  • Page 105: Addvlineend Method

    Chapter 4 ePOS-Print API addVLineEnd method Adds the end of vertical line to the command buffer. Finishes drawing vertical lines. • Not available in page mode. • Use this API function with addVLineBegin (p. 103). Syntax addVLineEnd(x, style); Parameter  x : ( Required parameter, Object type : Number) Specifies the end position of the vertical line (in dots). Specifies an integer from 0 to 65535.  style : ( Optional parameter, Object type : String) Specifies the type of the line you want to finish drawing. Constant (style) Description LINE_THIN Solid line: Thin LINE_MEDIUM Solid line: Medium...
  • Page 106 Example To draw thin vertical lines at 100 dots and 200 dots from the left end: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addVLineBegin(100).addVLineBegin(200); builder.addFeedUnit(100); builder.addVLineEnd(100).addVLineEnd(200); //--> </script>...
  • Page 107: Addpagebegin Method

    Return value Return value Object type ePOS-Print Builder Object ePOS Builder Example To print the characters "ABCDE" in page mode: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addPageBegin(); builder.addText('ABCDE'); builder.addPageEnd(); //--> </script>...
  • Page 108: Addpageend Method

    Return value Return value Object type ePOS-Print Builder Object ePOS Builder Example To print the characters "ABCDE" in page mode: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addPageBegin(); builder.addText('ABCDE'); builder.addPageEnd(); //--> </script>...
  • Page 109: Addpagearea Method

    Chapter 4 ePOS-Print API addPageArea method Adds the print area in page mode to the command buffer. Specifies the print area in page mode (coordinates). After this API function, specify a print data API function such as the addText method. •...
  • Page 110 To specify the print area with the origin (100, 50), a width of 200 dots, and a height of 30 dots and print the characters "ABCDE": <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addPageBegin(); builder.addPageArea(100, 50, 200, 30); builder.addText('ABCDE'); builder.addPageEnd(); //-->...
  • Page 111: Addpagedirection Method

    Chapter 4 ePOS-Print API addPageDirection method Adds the page mode print direction setting to the command buffer. Specifies the print direction in page mode. This function can be omitted if rotation is not required. Use this API function by inserting it between addPageBegin (p. 107) and PageEnd (p. 108). Syntax addPageDirection(dir); Parameter  dir : ( Required parameter, Object type : String)...
  • Page 112 Example To print the characters "ABCDE" by rotating them 90 degrees clockwise: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addPageBegin(); builder.addPageArea(100, 50, 30, 200); builder.addPageDirection(builder.DIRECTION_TOP_TO_BOTTOM); builder.addText('ABCDE'); builder.addPageEnd(); //--> </script>...
  • Page 113: Addpageposition Method

    Chapter 4 ePOS-Print API addPagePosition method Adds the page mode print-position-set area to the command buffer. Specifies the print start position (coordinates) in the area specified by the addPageArea method. Use this API function by inserting it between addPageBegin (p. 107) and PageEnd (p. 108). Syntax addPagePosition(x, y); Parameter  x : ( Required parameter, Object type : Number) Specifies the horizontal print position (in dots). Specifies an integer from 0 to 65535.  y : ( Required parameter, Object type : Number)...
  • Page 114 To specify (50,30) for the print start position in the area specified by the addPageArea method and print the characters "ABCDE": <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addPageBegin(); builder.addPageArea(100, 50, 200, 100); builder.addPagePosition(50, 30); builder.addText('ABCDE'); builder.addPageEnd();...
  • Page 115: Addpageline Method

    Chapter 4 ePOS-Print API addPageLine method Adds line drawing in page mode to the command buffer. Draws a line in page mode. • Diagonal lines cannot be drawn. • Use this API function by inserting it between addPageBegin (p. 107) and PageEnd (p. 108). Syntax addPageLine(x1, y1, x2, y2, style); Parameter  x 1: ( Required parameter, Object type : Number) Specifies the horizontal start position of the line (in dots). Specifies an integer from 0 to 65535.  y 1: ( Required parameter, Object type : Number) Specifies the vertical start position of the line (in dots). Specifies an integer from 0 to 65535.
  • Page 116 To draw a thin solid line between the start position (100, 0) and the end position (500, 0): <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addPageBegin(); builder.addPageLine(100, 0, 500, 0, builder.LINE_THIN); builder.addPageEnd(); //-->...
  • Page 117: Addpagerectangle Method

    Chapter 4 ePOS-Print API addPageRectangle method Adds rectangle drawing in page mode to the command buffer. Draws a rectangle in page mode. Use this API function by inserting it between addPageBegin (p. 107) and PageEnd (p. 108). Syntax addPageRectangle(x1, y1, x2, y2, style); Parameter  x 1: ( Required parameter, Object type : Number) Specifies the horizontal start position of the line (in dots). Specifies an integer from 0 to 65535.  y 1: ( Required parameter, Object type : Number) Specifies the vertical start position of the line (in dots). Specifies an integer from 0 to 65535.  x2 : ( Required parameter, Object type : Number)...
  • Page 118 To draw a rectangle with a thin double line, with the start position (100, 0) and the end position (500, 200) as its vertexes: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addPageBegin(); builder.addPageLine(100, 0, 500, 200, builder.LINE_THIN_DOUBLE); builder.addPageEnd(); //--> </script>...
  • Page 119: Addcut Method

    Chapter 4 ePOS-Print API addCut method Adds paper cut to the command buffer. Sets paper cut. Not available in page mode. Syntax addCut(type); Parameter  type : ( Optional parameter, Object type : String) Specifies the paper cut type. Setting Description Cut without feeding CUT_NO_FEED (The paper is cut without being fed.) Feed cut CUT_FEED (The paper is fed to the cut position and then is cut.) Cut reservation CUT_RESERVE...
  • Page 120 Example To perform feed cut operation: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addCut(builder.CUT_FEED); //--> </script>...
  • Page 121: Addpulse Method

    Chapter 4 ePOS-Print API addPulse method Adds the drawer kick to the command buffer. Sets the drawer kick. • Not available in page mode. • The drawer and the buzzer cannot be used together. Syntax addPulse(drawer, time); Parameter  drawer : ( Optional parameter, Object type : String) Specifies the drawer kick connector. Setting Description DRAWER_1 Pin 2 of the drawer kick-out connector DRAWER_2 Pin 5 of the drawer kick-out connector undefined...
  • Page 122 Example To send a 100msec pulse signal to the pin 2 of the drawer kick connector: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addPulse(builder.DRAWER_1, builder.PULSE_100); //--> </script>...
  • Page 123: Addsound Method

    Chapter 4 ePOS-Print API addSound method Adds the turning on of the buzzer to the command buffer. Sets the buzzer. • Not available in page mode. • The buzzer function and the drawer cannot be used together. • This API function cannot be used if the printer is not provided with the buzzer. Syntax addSound(pattern, repeat, cycle); Parameter  pattern : (  Optional parameter, Object type : String) Specifies the buzzer pattern. Setting Description PATTERN_NONE Stop PATTERN_A Pattern A PATTERN_B Pattern B...
  • Page 124 Builder Exception Exception Object type Parameter " ... " is invalid Error Example To repeat the sound pattern A three times: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addSound(builder.PATTERN_A, 3); //--> </script>...
  • Page 125: Addlayout Method

    Chapter 4 ePOS-Print API addLayout method Adds paper layout information to the command buffer. Setting of page layout must be done in the standard mode. In the page mode, addLayout  cannot be specified. Syntax addLayout(type, width, height, margin_top,  margin_bottom, offset_cut, offset_label); Parameter  type : (  Required parameter, Object type : String) Specifies the paper type. Constant (type) Description LAYOUT_RECEIPT Receipt (without black mark) LAYOUT_RECEIPT_BM Receipt (with black mark) LAYOUT_LABEL Die-cut label (without black mark) LAYOUT_LABEL_BM...
  • Page 126  margin_top : ( Optional parameter, Object type : Number, When not specified : 0) Specifies top margin (in units of 0.1mm). Paper Type Valid value range Description Receipt  Setup not necessary (without black mark) Distance from the top of Receipt (with black mark) -150 to 1500 * black mark Die-cut label  Distance from the top of 0 to 1500 * (without black mark) label...
  • Page 127 Chapter 4 ePOS-Print API  offset_label* : ( Optional parameter, Object type : Number, When not specified : 0) Specifies label bottom position (sd) per 0.1mm unit. Paper Type Valid value range Description Receipt  (without black mark) Receipt (with black mark) Setup not necessary Die-cut label  (without black mark) Distance from the top of Die-cut label 0 to 15 * black mark to the bottom of (with black mark) label...
  • Page 128 Detailed description See below for the parameters that can be specified for each type of paper, and the positions for those parameters. Mark Parameter width height margin_top margin_bottom offset_cut offset_label <without Black Mark> <with Black Mark> Top position Receipt Top position Top position Label Bottom edge...
  • Page 129 Chapter 4 ePOS-Print API Example To set 58mm receipt (without black mark): <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addLayout(builder.LAYOUT_RECEIPT, 580); //--> </script> To set 58mm receipt (with black mark): <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript">...
  • Page 130: Addrecovery Method

    Parameter " ... " is invalid Error Example Recovers from errors that can be recovered from and clears the buffer: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.force = true; builder.addRecovery(); //--> </script>...
  • Page 131: Addreset Method

    Return value Object type ePOS-Print Builder Object ePOS Builder Exception Exception Object type Parameter " ... " is invalid Error Example Resets the printer: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addReset(); //--> </script>...
  • Page 132: Addcommand Method

    Return value Object type ePOS-Print Builder Object ePOS Builder Exception Exception Object type Parameter " ... " is invalid Error Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); var doc = builder.addCommand('ABC\x44\x45\x0a'); //--> </script>...
  • Page 133: Tostring Method

    Obtains a print document generated by an ePOS-Print Builder object. Syntax toString(); Return value Return value Object type Document to be printed String Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); var doc = builder.toString(); //--> </script>...
  • Page 134: Halftone Property

    To set the halftone type as error diffusion: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); var canvas = document.getElementById('canvas'); if (canvas.getContext) { var context = canvas.getContext('2d'); builder.halftone = epos.HALFTONE_ERROR_DIFFUSION; builder.addImage(context, 0, 0, canvas.width, canvas.height);...
  • Page 135: Brightness Property

    Example To set brightness as 2.2: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); var canvas = document.getElementById('canvas'); if (canvas.getContext) { var context = canvas.getContext('2d'); builder.brightness = 2.2; builder.addImage(context, 0, 0, canvas.width, canvas.height); //-->...
  • Page 136: Force Property

     Stopping the buzzer (addSound method (p.123))  Recovery from errors that can be recovered from (addRecovery method (p.130))  Reset (addReset method (p.131))  Sending commands in real time (addCommand method (p.132)) Example Performs a drawer kick-out when the paper is at the end: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.force = true; builder.addPulse(); //--> </script>...
  • Page 137: Message Property

    Example To clear the command and reset it to the initial state: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function buildMessage() { var builder = new epson.ePOSBuilder(); builder.addText('ABCDE'); builder.message = ''; //--> </script>...
  • Page 138: Epos-Print Object

    The URL is as follows: http://[IP address of ePOS-Print supported TM printer]/cgi-bin/epos/ service.cgi?devid=[device ID of printer to be used for printing]&timeout=[timeout time] Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function sendMessage() { var address = 'http://192.168.192.168/cgi-bin/epos/ service.cgi?devid=local_printer'; var epos = new epson.ePOSPrint(address); //--> </script>...
  • Page 139: Send Method

    XMLHttpRequest is not supported Error Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function printHellowWorld() { var builder = new epson.ePOSBuilder(); builder.addText('Hello, World!\n'); builder.addCut(); var request = builder.toString(); var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var epos = new epson.ePOSPrint(address); epos.onreceive = function (res) { alert(res.success); };...
  • Page 140: Open Method

    Updates the status at the interval specified by the interval property. Syntax open(); Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer' var epos = new epson.ePOSPrint(address); epos.oncoveropen = function () { alert('coveropen'); function startMonitor() { epos.open(); function stopMonitor() { epos.close(); //-->...
  • Page 141: Close Method

    Disables status event operation. (in firmware Ver.1.2 and later) Syntax close(); Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer' var epos = new epson.ePOSPrint(address); epos.oncoveropen = function () { alert('coveropen'); function startMonitor() { epos.open(); function stopMonitor() { epos.close(); //-->...
  • Page 142: Address Property

    ID of printer to be used for printing]&timeout=[timeout time] The default value is the address specified by the constructor. Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var epos = new epson.ePOSPrint(); epos.address = 'http://192.168.192.168/cgi-bin/epos/ service.cgi?devid=local_printer'; epos.oncoveropen = function () { alert('coveropen'); }; epos.open(); //--> </script>...
  • Page 143: Enabled Property

    The enabled/disabled setting for status event operation is retained using a logical value. This is read-only. The default value is false. Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var epos = new epson.ePOSPrint(address); epos.oncoveropen = function () { alert('coveropen'); }; epos.open(); alert(epos.enabled); //--> </script>...
  • Page 144: Interval Property

    When an invalid value is specified, it is assumed to be 3000. Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var epos = new epson.ePOSPrint(address); epos.interval = 1000; epos.oncoveropen = function () { alert('coveropen'); }; epos.open(); //--> </script>...
  • Page 145: Status Property

    This is the status last obtained from the printer. This is read-only. Default value: 0 Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var epos = new epson.ePOSPrint(address); epos.onoffline = function () { alert(epos.status); epos.open(); //--> </script>...
  • Page 146: Battery Property

    Description Battery status obtained from the last printer status. This is read-only. Default value: 0 Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var epos = new epson.ePOSPrint(address); epos.onbatterylow = function () { alert(epos.battery); epos.open(); //--> </script>...
  • Page 147: Timeout Property

    Default value: 300000 (5 minutes) Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var builder = new epson.ePOSBuilder(); builder.addText('Hello, World!\n'); builder.addCut(); var request = builder.toString(); var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var epos = new epson.ePOSPrint(address);...
  • Page 148: Onreceive Event

    onreceive event This property registers the callback function and obtains a response message receipt event. Syntax Function (response) Parameter of the callback function Parameters: response (See “Properties of the response object” on page 148.) Name: Response message Object type: Object Properties of the response object Property Name Object type success 148) Print result Boolean code...
  • Page 149 Chapter 4 ePOS-Print API  Value of status Constant (status) Description No response from the TM printer ASB_NO_RESPONSE Printing is successfully completed ASB_PRINT_SUCCESS ASB_DRAWER_KICK Status of the 3rd pin of the drawer kick-out connector = "H" Battery offline status ASB_BATTERY_OFFLINE (only for applicable devices) (in firmware Ver.2.2 and later) Offline ASB_OFF_LINE...
  • Page 150 To create and send a print document. To display the print result in a message box. <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function printHellowWorld() { var builder = new epson.ePOSBuilder(); builder.addText('Hello, World!\n'); builder.addCut(); var request = builder.toString(); var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var epos = new epson.ePOSPrint(address);...
  • Page 151: Onerror Event

    To display the HTTP status code in a message box when a communication error occurs. <script type="text/javascript" src=”epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function printHellowWorld() { var builder = new epson.ePOSBuilder(); builder.addText('Hello, World!\n'); builder.addCut(); var request = builder.toString(); var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer';...
  • Page 152: Onstatuschange Event

    Registers a callback function to obtain a status change event. (in firmware Ver.1.2 and later) Syntax Function (status) Parameter of the callback function Parameters: status Name: Status Object type: Number Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var epos = new epson.ePOSPrint(address); epos.onstatuschange = function (status) { alert(status); epos.open(); //--> </script>...
  • Page 153: Onbatterystatuschange Event

    Object type: Number Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var epos = new epson.ePOSPrint(address); epos.onbatterystatuschange = function (battery) { alert(battery); epos.open(); //--> </script> ononline event Registers a callback function to obtain a online event. (in firmware Ver.1.2 and later)
  • Page 154: Onoffline Event

    Object type Function () Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var epos = new epson.ePOSPrint(address); epos.onoffline = function () { alert('offline'); epos.open(); //--> </script> onpoweroff event Registers a callback function to obtain a non-response event. (in firmware Ver.1.2 and later)
  • Page 155: Oncoverok Event

    Object type Function () Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var epos = new epson.ePOSPrint(address); epos.oncoverok = function () { alert('coverok'); epos.open(); //--> </script> oncoveropen event Registers a callback function to obtain a cover open event. (in firmware Ver.1.2 and later)
  • Page 156: Onpaperok Event

    Object type Function () Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var epos = new epson.ePOSPrint(address); epos.onpaperok = function () { alert('paperok'); epos.open(); //--> </script> onpapernearend event Registers a callback function to obtain a paper near end event. (in firmware Ver.1.2 and later)
  • Page 157: Onpaperend Event

    Object type Function () Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var epos = new epson.ePOSPrint(address); epos.onpaperend = function () { alert('paperend'); epos.open(); //--> </script> ondrawerclosed event Registers a callback function to obtain a drawer close event. (in firmware Ver.1.2 and later)
  • Page 158: Ondraweropen Event

    Object type Function () Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var epos = new epson.ePOSPrint(address); epos.ondraweropen = function () { alert('draweropen'); epos.open(); //--> </script> onbatteryok event Registers call back function and obtains remaining battery event. (in firmware Ver.2.2 and later)
  • Page 159: Onbatterylow Event

    Registers call back function and obtains no remaining battery event. (in firmware Ver.2.2 and later) Object type Function () Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var epos = new epson.ePOSPrint(address); epos.onbatterylow = function () { alert('batterylow'); epos.open(); //--> </script>...
  • Page 161: Epos-Print Canvas Api

    Chapter 5 ePOS-Print Canvas API ePOS-Print Canvas API This chapter describes the ePOS-Print Canvas API. List of ePOS-Print Canvas API functions The ePOS-Print Canvas API provides the following object: ❏ ePOS-Print Canvas API (window.epson.CanvasPrint) object 161) window.epson.CanvasPrint Components Element Description...
  • Page 162 Element Description Page Property mode Color mode (in firmware Ver.1.2 and later) align Position alignment color Printing color Control of label paper/black mark paper feed (in firmware Ver.2.1 and later) paper Type of papers (in firmware Ver.2.1 and later) layout Paper layout (in firmware Ver.2.2 and later) Event onreceive...
  • Page 163 Chapter 5 ePOS-Print Canvas API Element Description Page Constant ASB_* Response document status HALFTONE_* Halftone type MODE_* Color mode ALIGN_* Position alignment COLOR_* Color specification FEED_* Paper feed position of label paper/black mark paper PAPER_* Type of papers...
  • Page 164: Epos-Print Canvas Api Object

    Parameter  address : ( Optional parameter, Object type  : String) Specifies the address property (URL of printer to be used for printing). The URL is as follows: http://[ePOS-Print supported TM printer]/cgi-bin/epos/service.cgi?devid=[device ID of printer to be used for printing]&timeout=[timeout time] Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function printCanvas() { var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var epos = new epson.CanvasPrint(address); //--> </script>...
  • Page 165: Print Method

    Chapter 5 ePOS-Print Canvas API print method Prints an image rendered in HTML5 Canvas. Converts the specified range in a RGBA full-color image of HTML5 Canvas into raster image data according to the settings of the halftone and brightness properties. One pixel in an image equals to one printer dot. When an image contains any transparent color, the background color of the image is assumed to be white.
  • Page 166 To print Canvas(ID=’myCanvas’): <script type="text/javascript" src=”epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function printCanvas() { var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var canvas = document.getElementById('myCanvas'); var epos = new epson.CanvasPrint(address); epos.onreceive = function (res) { alert(res.success); }; epos.onerror = function (err) { alert(err.status); }; epos.print(canvas); //--> </script>...
  • Page 167: Open Method

    Updates the status at the interval specified by the interval property. Syntax open(); Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var epos = new epson.CanvasPrint(address); epos.oncoveropen = function () { alert('coveropen'); function startMonitor() { epos.open(); function stopMonitor() { epos.close(); //-->...
  • Page 168: Close Method

    Disables status event operation. (in firmware Ver.1.2 and later) Syntax close(); Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var epos = new epson.CanvasPrint(address); epos.oncoveropen = function () { alert('coveropen'); function startMonitor() { epos.open(); function stopMonitor() { epos.close(); //-->...
  • Page 169: Recover Method

    Recovers from errors that can be recovered from and clears the buffer. Syntax recover(); Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var epos = new epson.CanvasPrint(address); epos.oncoveropen = function () { alert('coveropen'); function recover() { epos.recover(); //--> </script> reset method Resets the printer.
  • Page 170: Address Property

    ID of printer to be used for printing]&timeout=[timeout time] The default value is the address specified by the constructor. Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var epos = new epson.CanvasPrint(); epos.address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; epos.oncoveropen = function () { alert('coveropen'); }; epos.open(); //--> </script>...
  • Page 171: Enabled Property

    The enabled/disabled setting for status event operation is retained using a logical value. This is read-only. The default value is false. Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var epos = new epson.CanvasPrint(address); epos.oncoveropen = function () { alert('coveropen'); }; epos.open(); alert(epos.enabled); //--> </script>...
  • Page 172: Interval Property

    When an invalid value is specified, it is assumed to be 3000. Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var epos = new epson.CanvasPrint(address); epos.interval = 1000; epos.oncoveropen = function () { alert('coveropen'); }; epos.open(); //--> </script>...
  • Page 173: Status Property

    This is the status last obtained from the printer. This is read-only. Default value: 0 Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var epos = new epson.CanvasPrint(address); epos.onoffline = function () { alert(epos.status); epos.open(); //--> </script>...
  • Page 174: Battery Property

    Description Battery status obtained from the last printer status. This is read-only. Default value: 0 Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var epos = new epson.CanvasPrint(address); epos.onbatterylow = function () { alert(epos.battery); epos.open(); //--> </script>...
  • Page 175: Timeout Property

    Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var canvas = document.getElementById('myCanvas'); var epos = new epson.CanvasPrint(address); epos.timeout = 60000; epos.onreceive = function (res) { alert(res.success); }; epos.onerror = function (err) { alert(err.status); }; epos.print(canvas); //--> </script>...
  • Page 176: Halftone Property

    Threshold, suitable for printing text only. Example To set the halftone type as error diffusion: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var canvas = document.getElementById('myCanvas'); var epos = new epson.CanvasPrint(address); epos.halftone = epos.HALFTONE_ERROR_DIFFUSION; epos.print(canvas); //--> </script>...
  • Page 177: Brightness Property

    A gamma value in the range 0.1-10.0 is specified for the brightness correction value. The default value is 1.0. Example To set brightness as 2.2: <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var canvas = document.getElementById('myCanvas'); var epos = new epson.CanvasPrint(address); epos.brightness = 2.2; epos.print(canvas); //--> </script>...
  • Page 178: Cut Property

    Cut paper after printing false/0 (Default) Do not cut paper Example It sets paper cut after printing. <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var canvas = document.getElementById('myCanvas'); var epos = new epson.CanvasPrint(address); epos.cut = true; epos.print(canvas); //--> </script>...
  • Page 179: Mode Property

    Value Decription MODE_MONO (Default) Monochrome (2-tone) MODE_GRAY16 Multiple tones (16-tone) Example Prints with multiple tones. <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var canvas = document.getElementById('myCanvas'); var epos = new epson.CanvasPrint(address); epos.mode = epos.MODE_GRAY16; epos.print(canvas); //--> </script>...
  • Page 180: Align Property

    ALIGN_CENTER Alignment to the center ALIGN_RIGHT Alignment to the right Example Prints with center alignment. <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var canvas = document.getElementById('myCanvas'); var epos = new epson.CanvasPrint(address); epos.align = epos.ALIGN_CENTER; epos.print(canvas); //--> </script>...
  • Page 181: Color Property

    COLOR_2 2nd color COLOR_3 3rd color COLOR_4 4th color Example Prints with the 2nd color. <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var canvas = document.getElementById('myCanvas'); var epos = new epson.CanvasPrint(address); epos.color = epos.COLOR_2; epos.print(canvas); //--> </script>...
  • Page 182: Feed Property

    Example After printing a label, it feeds paper to the peeling position. <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var canvas = document.getElementById('myCanvas'); var epos = new epson.CanvasPrint(address); epos.paper = epos.PAPER_LABEL; epos.feed = epos.FEED_PEELING; epos.print(canvas); //--> </script>...
  • Page 183: Paper Property

    Die-cut label (without black mark) PAPAER_LABEL_BM Die-cut label (with black mark) Example Prints a label. <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var canvas = document.getElementById('myCanvas'); var epos = new epson.CanvasPrint(address); epos.paper = epos.PAPER_LABEL; epos.feed = epos.FEED_PEELING; epos.print(canvas); //--> </script>...
  • Page 184: Layout Property

    layout property It sets paper layout. (in firmware Ver.2.2 and later) Object type Object Description It specifies paper layout. Property of layout being setup Property Name Object type width Paper width Number height Paper height Number margin_top Top margin Number margin_bottom Bottom margin Number...
  • Page 185 Chapter 5 ePOS-Print Canvas API  Value of margin_top (Object type : Number, When not specified : 0) Specifies top margin (in units of 0.1mm). Paper type Valid value range Description Receipt  Setup not necessary (without black mark) -150 to 1500 * Distance from the top of black Receipt (with black mark) mark...
  • Page 186  Value of offset_label (Object type : Number, When not specified : 0) Specifies label bottom position (sd) per 0.1mm unit. Paper type Valid value range Description Receipt  Setup not necessary (without black mark) Receipt (with black mark) Die-cut label  (without black mark) Die-cut label...
  • Page 187 To set 58mm receipt (without black mark): <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var canvas = document.getElementById('myCanvas'); var epos = new epson.CanvasPrint(address); epos.paper = epos.PAPER_RECEIPT; epos.layout = { width: 580 }; epos.cut = true; epos.print(canvas); //-->...
  • Page 188 <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var canvas = document.getElementById('myCanvas'); var epos = new epson.CanvasPrint(address); epos.paper = epos.PAPER_LABEL_BM; epos.layout = { width: 580, height: 0, margin_top: 15, margin_bottom: -15 offset_cut: 25, offset_label: 15 }; epos.cut = true;...
  • Page 189: Onreceive Event

    Chapter 5 ePOS-Print Canvas API onreceive event This property registers the callback function and obtains a response message receipt event. Syntax Function (response) Parameter of the callback function Parameter: response (See “Properties of the response object” on page 189.) Name: Response message Object type: Object...
  • Page 190  Value of satus Constant (status) Decription ASB_NO_RESPONSE No response from the TM printer ASB_PRINT_SUCCESS Printing is successfully completed ASB_DRAWER_KICK Status of the 3rd pin of the drawer kick-out connector = "H" ASB_BATTERY_OFFLINE Off line status from remaining battery (only for applicable devices) (in firmware Ver.2.2 and later) ASB_OFF_LINE Offline ASB_COVER_OPEN...
  • Page 191 <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function printCanvas() { var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var canvas = document.getElementById('myCanvas'); var epos = new epson.CanvasPrint(address); epos.onreceive = function (res) { var success = res.success; var code = res.code; var status = res.status; alert(success);...
  • Page 192: Onerror Event

    To display the HTTP status code in a message box when a communication error occurs. <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- function printCanvas() { var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var canvas = document.getElementById('myCanvas'); var epos = new epson.CanvasPrint(address); epos.onerror = function (err) { var status = err.status; var text = err.responseText; alert(status); epos.print(canvas); //-->...
  • Page 193: Onstatuschange Event

    Registers a callback function to obtain a status change event. (in firmware Ver.1.2 and later) Syntax Function (status) Parameter of the callback function Parameters: status Name: Status Object type: Number Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var epos = new epson.CanvasPrint(address); epos.onstatuschange = function (status) { alert(status); epos.open(); //--> </script>...
  • Page 194: Onbatterystatuschange Event

    Registers call back function and obtains battery status change event. (in firmware Ver.2.2 and later) Syntax Function (battery) Parameter of the callback function Parameters: battery Name: Battery status Object type: Number Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var epos = new epson.CanvasPrint(address); epos.onbatterystatuschange = function (battery) { alert(battery); epos.open(); //--> </script>...
  • Page 195: Onbatteryok Event

    Syntax Function () Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var epos = new epson.CanvasPrint(address); epos.onbatteryok = function () { alert('batteryok’); epos.open(); //--> </script> onbatterylow event Registers call back function and obtains no remaining battery event. (in firmware Ver.2.2 and later)
  • Page 196: Ononline Event

    Object type Function () Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var epos = new epson.CanvasPrint(address); epos.ononline = function () { alert('online'); epos.open(); //--> </script> onoffline event Registers a callback function to obtain a offline event. (in firmware Ver.1.2 and later)
  • Page 197: Onpoweroff Event

    Object type Function () Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var epos = new epson.CanvasPrint(address); epos.onpoweroff = function () { alert('poweroff'); epos.open(); //--> </script> oncoverok event Registers a callback function to obtain a cover close event. (in firmware Ver.1.2 and later)
  • Page 198: Oncoveropen Event

    Object type Function () Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var epos = new epson.CanvasPrint(address); epos.oncoveropen = function () { alert('coveropen'); epos.open(); //--> </script> onpaperok event Registers a callback function to obtain a paper remaining event. (in firmware Ver.1.2 and later)
  • Page 199: Onpapernearend Event

    Object type Function () Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var epos = new epson.CanvasPrint(address); epos.onpapernearend = function () { alert('papernearend'); epos.open(); //--> </script> onpaperend event Registers a callback function to obtain a paper end event. (in firmware Ver.1.2 and later)
  • Page 200: Ondrawerclosed Event

    Object type Function () Example <script type="text/javascript" src="epos-print-3.x.x.js"></script> <script type="text/javascript"> <!-- var address = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer'; var epos = new epson.CanvasPrint(address); epos.ondrawerclosed = function () { alert('drawerclosed'); epos.open(); //--> </script> ondraweropen event Registers a callback function to obtain a drawer open event. (in firmware Ver.1.2 and later)
  • Page 201: Epos-Print Editor

    Chapter 6 ePOS-Print Editor ePOS-Print Editor This section describes how to use ePOS-Print Editor included in the contents in the package. This tool allows you to create an ePOS-Print API 59) sample code as you like. Use this tool for your Web application development.
  • Page 202: Displaying Epos-Print Editor

    Displaying ePOS-Print Editor • If opening a page with ePOS‐Print Editorʹs HTML file placed on the local disk, some  functionality does not operate due to your Web browserʹs security policy. Place the HTML file  of ePOS Editor to a folder under Web server. • In Google Chrome, when a preview image including pictures is displayed, a ʺSECURITY_ERR:  DOM Exception 18ʺ error occurs.    • In Windows Internet Explorer 9, when printing is performed, a ʺSCRIPT5: Access is denied.ʺ  error occurs. Open the following URL page using the Web browser. http://[Web server IP address]/editor/index.html ePOS-Print Editor appears.
  • Page 203: Setting

    Chapter 6 ePOS-Print Editor Setting Perform the print setting and the preview setting. Select the [Setting] tab to display the Setting screen. Item Description Model, Paper width (Liner width) Select printer model to be used and paper width (for label paper, the mount width).
  • Page 204: Creating A Sample Code

    Creating a Sample Code Select the [Edit] tab to display the Edit screen. Create an ePOS-Print API sample code in the Edit screen. Edit area Menu area Item Description Menu area Displays the available functions. Click an icon to add it to the bottom of the edit area, and drag an icon to insert it anywhere in the edit area.
  • Page 205 Chapter 6 ePOS-Print Editor Create a sample code as follows: Click an icon in the menu area to add an element in the edit area. The position of the added function can be changed by dragging. Configure the added element. Example: When the NV logo is added, set the key code.
  • Page 206 Select the [API] tab. The ePOS-Print API sample code appears. Use it by copying. The ePOS‐Print XML print document is used for importing. If necessary, select the XML tab and  save the content of the ePOS‐Print XML print document by copying. ...
  • Page 207: Print

    Chapter 6 ePOS-Print Editor Print Using the printer, print the print document according to the printer's settings to perform test printing.. (For details on the printer settings, refer to Setting (p.203)). Item Description Data to be sent The ePOS-Print XML document is displayed. (ePOS-Print XML) Send Sends data to the printer and performs printing.
  • Page 208: Import

    Import ePOS-Print Editor can import and re-edit the ePOS-Print XML print document once created. Note that you cannot perform import operation using ePOS‐Print API source code.  Perform import operation using ePOS‐Print XML print data.  Item Description Data to be import Paste and check the ePOS-Print XML print document to be imported. (ePOS-Print XML) Apply Imports the ePOS-Print XML print document. Information Displays the import information.
  • Page 209: Appendix

    Appendix Appendix Printer specifications TM-T88V-i 80mm Interface Ethernet, Wireless LAN Resolution 180 dpi x 180 dpi (W x H) Print Width 512 dots Font Font A, Font B For more information about what character codes can be printed, refer to the user's manual that came with the printer.
  • Page 210 80mm Ruled Line Not supported Paper Cut Cut, Feed cut Specification of the paper feed position for labels / black mark Not supported paper Drawer Kick-Out Supported Buzzer Optional (Pattern A ~ Pattern E, Error, No paper, Stop) Paper Layout Settings Not supported Forced transmission mode Supported...
  • Page 211: Tm-T88V

    Appendix TM-T88V 80mm 58mm Interface Ethernet, Wireless LAN Resolution 180 dpi x 180 dpi (W x H) Print Width 512 dots 360 dots Font Font A, Font B For more information about what character codes can be printed, refer to the user's manual that came with the printer. Characters in a Line Font A ANK: 42 characters...
  • Page 212 80mm 58mm Buzzer Optional (Pattern A ~ Pattern E, Error, No paper, Stop) Paper Layout Settings Not supported Forced transmission mode Supported Recovery from an error Supported Reset Supported Command Supported...
  • Page 213: Tm-T88Iv

    Appendix TM-T88IV 80mm 58mm Interface Ethernet, Wireless LAN Resolution 180 dpi x 180 dpi (W x H) Print Width 512 dots 360 dots Font Font A, Font B For more information about what character codes can be printed, refer to the user's manual that came with the printer. Characters in a Line Font A ANK: 42 characters...
  • Page 214 80mm 58mm Specification of the paper feed position for labels / black mark Not supported paper Drawer Kick-Out Supported Buzzer Not supported Paper Layout Settings Not supported Forced transmission mode Supported Recovery from an error Supported Reset Supported Command Supported...
  • Page 215: Tm-T70-I

    Appendix TM-T70-i 80mm Interface Ethernet, Wireless LAN Resolution 180 dpi x 180 dpi (W x H) dots Print Width Font Font A, Font B For more information about what character codes can be printed, refer to the user's manual that came with the printer. Characters in a Line Font A ANK: 42 characters...
  • Page 216 80mm Forced transmission mode Supported Recovery from an error Supported Reset Supported Command Supported...
  • Page 217: Tm-T70-I (Multi-Language Model)

    Appendix TM-T70-i (Multi-language model) 80mm Interface Ethernet, Wireless LAN Resolution 203 dpi x 203 dpi (W x H) dots Print Width Font Font A, Font B For more information about what character codes can be printed, refer to the user's manual that came with the printer. Characters in a Line Font A ANK: 48 characters...
  • Page 218 80mm Forced transmission mode Supported Recovery from an error Supported Reset Supported Command Supported...
  • Page 219: Tm-T70

    Appendix TM-T70 80mm Interface Ethernet, Wireless LAN Resolution 180 dpi x 180 dpi (W x H) dots Print Width Font Font A, Font B For more information about what character codes can be printed, refer to the user's manual that came with the printer. Characters in a Line Font A ANK: 42 characters...
  • Page 220 80mm Paper Layout Settings Not supported Forced transmission mode Supported Recovery from an error Supported Reset Supported Command Supported...
  • Page 221: Tm-T70 (Multi-Language Model)

    Appendix TM-T70 (Multi-language model) 80mm 58mm Interface Ethernet, Wireless LAN Resolution 203 dpi x 203 dpi (W x H) dots dots Print Width Font Font A, Font B For more information about what character codes can be printed, refer to the user's manual that came with the printer. Characters in a Line Font A ANK: 42 characters...
  • Page 222 80mm 58mm Forced transmission mode Supported Recovery from an error Supported Reset Supported Command Supported...
  • Page 223: Tm-L90-I

    Appendix TM-L90-i Receipt Die-cut label Interface Ethernet, Wireless LAN Resolution 203 dpi x 203 dpi (W x H) Print Width 256 dots (38mm) to 224 dots (38mm) to 576 dots (80mm) 560 dots (80mm) Font Font A, Font B, Font C For more information about what character codes can be printed, refer to the user's manual that came with the printer.
  • Page 224 Receipt Die-cut label Page Mode Default Area 576 dots x 738 dots (W x H) 560 dots x 738 dots (W x H) when two- 576 dots x 369 dots (W x H) 560 dots x 369 dots (W x H) color printing is set Page Mode Maximum Area...
  • Page 225: Tm-L90

    Appendix TM-L90 Receipt Die-cut label Interface Ethernet, Wireless LAN Resolution 203 dpi x 203 dpi (W x H) Print Width 256 dots (38mm) to 224 dots (38mm) to 576 dots (80mm) 560 dots (80mm) Font Font A, Font B, Font C For more information about what character codes can be printed, refer to the user's manual that came with the printer.
  • Page 226 Receipt Die-cut label Page Mode Default Area 576 dots x 738 dots (W x H) 560 dots x 738 dots (W x H) when two- 576 dots x 369 dots (W x H) 560 dots x 369 dots (W x H) color printing is set Page Mode Maximum Area...
  • Page 227: Tm-T90

    Appendix TM-T90 58mm 60mm 80mm Interface Ethernet, Wireless LAN Resolution 180 dpi x 180 dpi (W x H) Print Width 360 dots 384 dots 512 dots Font Font A, Font B For more information about what character codes can be printed, refer to the user's manual that came with the printer.
  • Page 228 58mm 60mm 80mm Page Mode Maximum Area 360 dots x 1662 dots 384 dots x 1662 dots 512 dots x 1662 dots (W x H) (W x H) (W x H) when two-color printing is set 360 dots x 831 dots 384 dots x 831 dots 512 dots x 831 dots (W x H)
  • Page 229: Tm-P60Ii

    Appendix TM-P60II Receipt 58mm Receipt 60mm Interface Wireless LAN Resolution 203 dpi x 203 dpi (W x H) Print Width 420 dots 432 dots Font Font A, Font B, Font C For more information about what character codes can be printed, refer to the user's manual that came with the printer.
  • Page 230 Receipt 58mm Receipt 60mm Page Mode Line Supported (Only solid line) Rectangle Paper Cut Cut, Feed cut Specification of the paper feed position for labels / black mark Not supported paper Drawer Kick-Out Not supported Buzzer Support (Pattern1 ~ Pattern 10, Stop) Paper Layout Settings Not supported Forced transmission mode...
  • Page 231: Tm-P60Ii With Peeler

    Appendix TM-P60II with Peeler Receipt 58mm Receipt 60mm Die-cut label Interface Wireless LAN Resolution 203 dpi x 203 dpi (W x H) Print Width 420 dots 432 dots 160 dots ~ 400 dots Font Font A, Font B, Font C For more information about what character codes can be printed, refer to the user's manual that came with the printer.
  • Page 232 Receipt 58mm Receipt 60mm Die-cut label Page Mode Maximum Area 420 dots x 1200 dots 432 dots x 1200 dots 400 dots x 1200 dots (W x H) (W x H) (W x H) Page Mode Line Supported (Only solid line) Rectangle Paper Cut Feed cut (Feeds paper to cutting position)
  • Page 233: Tm-P80

    Appendix TM-P80 Receipt 80 mm Interface Wireless LAN Resolution 203 dpi x 203 dpi (W x H) Print Width 576 dots, 546 dots (42 column mode) Font Font A, Font B For more information about what character codes can be printed, refer to the user's manual that came with the printer.
  • Page 234 Receipt 80 mm Two-Dimensional Code PDF417, QR Code, MaxiCode, GS1 DataBar Stacked, GS1 DataBar Stacked Omnidirectional, GS1 DataBar Expanded Stacked, Aztec Code, DataMatrix Ruled Line Not supported Page Mode Default Area 576 dots x 1662 dots (W x H), 546 dots x 1662 dots (W x H) (42 column mode) Page Mode Maximum Area 576 dots x 1662 dots (W x H), 546 dots x 1662 dots (W x H) (42 column...
  • Page 235: Tm-T20

    Appendix TM-T20 58mm 80mm Interface Ethernet Resolution 203 dpi x 203 dpi (W x H) Print Width 420 dots 576 dots Font Font A, Font B For more information about what character codes can be printed, refer to the user's manual that came with the printer. Characters in a Font A ANK: 35 characters,...
  • Page 236 58mm 80mm Specification of the paper feed position for labels / black mark Not supported paper Drawer Kick-Out Supported Buzzer Optional (Pattern A ~ Pattern E, Error, No paper, Stop) Paper Layout Settings Not supported Forced transmission mode Supported Recovery from an error Supported Reset Supported...
  • Page 237: Tm-U220

    Appendix TM-U220 76mm 70mm 58mm Interface Ethernet, Wireless LAN Resolution 80 dpi x 72 dpi (W x H) Print Width 200 dots 180 dots 150 dots Font Font A, Font B For more information about what character codes can be printed, refer to the user's manual that came with the printer.
  • Page 238 76mm 70mm 58mm Specification of the paper feed position for labels / black mark Not supported paper Drawer Kick-Out Supported Buzzer Not supported Paper Layout Settings Not supported Forced transmission mode Not supported Recovery from an error Not supported Reset Supported Command Supported...
  • Page 239: Paper Setting Function Of Tm-L90

    Appendix Paper setting function of TM-L90 Setting Paper Width It sets the paper width with memory switch setting mode. Turn the printer's power off and set the receipt paper. While the cover is opened, turn the power on while pressing the FEED button. After confirming the ERROR LED lights up, press the FEED button twice and close the cover.
  • Page 240: Rendering In Html5 Canvas

    Rendering in HTML5 Canvas This section describes how to use Web pages using the ePOS-Print Canvas API in the package. You can try how to render images in HTML5 Canvas and see what images can be rendered. The following Web pages are available: •...
  • Page 241: Rendering Text (Canvas-Print-Text.html)

    Print text in HTML5 Canvas and perform a test print. Open the following URL page using the Web browser. http://[Web server IP address]/canvas/canvas-print-text.html “EPSON ePOS-Print Sample Program” appears.  Set items on the right of the page. The following items can be set: Item...
  • Page 242 Click the [Enter] button. The text is printed on Canvas on the left of the page according to the settings made on the right of the page. Set the following and click the [Print] button. Item Dscription Enter the following URL: http://[IP address of ePOS-Print supported TM printer]/cgi-bin/epos/ service.cgi?devid=[device ID of printer to be used for printing]&timeout=[timeout time]...
  • Page 243: Rendering Images (Canvas-Print-Image.html)

    Draw an image in HTML5 Canvas and perform a test print. Open the following URL page using the Web browser. http://[Web server IP address]/canvas/canvas-print-image.html “EPSON ePOS-Print Sample Program” appears.  Set items on the right of the page. The following items can be set: Item...
  • Page 244 Click the [Draw] button. The image is drawn on Canvas on the left of the page according to the settings made on the right of the page. Set the following and click the [Print] button. Item Description Enter the following URL: http://[IP address of ePOS-Print supported TM printer]/cgi-bin/epos/ service.cgi?devid=[device ID of printer to be used for printing]&timeout=[timeout time]...
  • Page 245: Rendering Graphics (Canvas-Print-Graph.html)

    Draw an image in HTML5 Canvas and perform a test print. Open the following URL page using the Web browser. http://[Web server IP address]/canvas/canvas-print-graph.html "EPSON ePOS-Print Sample Program" appears. Set items on the right of the page. The following items can be set: Item...
  • Page 246 Set the following and click the [Print] button. Item Description Enter the following URL: http://[IP address of ePOS-Print supported TM printer]/cgi-bin/epos/ service.cgi?devid=[device ID of printer to be used for printing]&timeout=[timeout time] Mode Set the color mode (Monochrome, Grayscale). Brightness Adjust the brightness. (Gamma value in the range 0.1-10.0) Set the halftone processing method for monochrome printing (two- Halftone tone).
  • Page 247: Rendering Handwritten Images (Canvas-Print-Hand.html)

    Open the following URL page using the Web browser. http://[Web server IP address]/canvas/canvas-print-hand.html “EPSON ePOS-Print Sample Program” appears. Set the size of the pen on the right of the page. Draw a freehand line on Canvas on the left of the page. For the mouse, drag it to draw a line;...
  • Page 248 Set the following and click the [Print] button. Item Description Enter the following URL: http://[IP address of ePOS-Print supported TM printer]/cgi-bin/epos/ service.cgi?devid=[device ID of printer to be used for printing]&timeout=[timeout time] Mode Set the color mode (Monochrome, Grayscale). Brightness Adjust the brightness. (Gamma value in the range 0.1-10.0) Set the halftone processing method for monochrome printing (two- Halftone tone).
  • Page 249: Rendering Barcode (Canvas-Print-Barcode.html)

    In the following example, an EAN13, JAN13 or UPC-A is drawn. Open the following URL page using the Web browser. http://[Web server IP address]/canvas/canvas-print-barcode.html "EPSON ePOS-Print Sample Program" appears. Set items on the right of the page. The following items can be set: Item...
  • Page 250 Click the [Draw] button. The image is drawn on Canvas on the left of the page according to the settings made on the right of the page. Set the following and click the [Print] button. Item Description Enter the following URL: http://[IP address of ePOS-Print supported TM printer]/cgi-bin/epos/ service.cgi?devid=[device ID of printer to be used for printing]&timeout=[timeout time]...
  • Page 251: Rendering Label (Canvas-Print-Label.html)

    Draw a label in HTML5 Canvas and perform a test print. Open the following URL page using the Web browser. http://[Web server IP address]/canvas/canvas-print-label.html "EPSON ePOS-Print Sample Program" appears. Set items on the right of the page. The following items can be set: Item...
  • Page 252 Click the [Draw] button. The image is drawn on Canvas on the left of the page according to the settings made on the right of the page. Set the following and click the [Print] button. Item Description Enter the following URL: http://[IP address of ePOS-Print supported TM printer]/cgi-bin/epos/ service.cgi?devid=[device ID of printer to be used for printing]&timeout=[timeout time]...
  • Page 253: Windows Store Apps

    Appendix Windows Store Apps In this section, how to use the sample program with Windows store apps is described. Sample Program Screen Display the [Sample] screen. Executes printing. It can print the following. Item Description Page Display the [Sample] screen. Executes printing. It can print the following.
  • Page 254 Print Image Your Number Coupon (ePOS-Print API) (ePOS-Print Canvas API) Your Number: Label* (ePOS-Print API) Item A Name Color Code *2012001* *: Die cut label: mount width 58mm or above Label size: width 54 mm x height 25.4 mm or above...
  • Page 255: Environment Of Sample Program

    Appendix Environment of Sample Program The environment of sample program is shown below. Item Description Development environment Microsoft Visual Studio 2012 (example) Required than Windows 8 Sample program file name win8/ePOS-Print Demo.zip Environment setting Procedure Configure your computer and ePOS-Print supported TM printer so that they can connect to the network.
  • Page 256: Sample Program Settings

    Sample Program Settings The screen is used to set the following: Item Description Specifies the IP address of the ePOS-Print supported printer. (Default value:  TM-i: DHCP IP address of the ePOS-Print (If an address fails to be assigned via DHCP , the value supported printer becomes "192.168.192.168".) ...
  • Page 257: Printing

    Appendix Printing It executes printing. Run the program according to the following procedure: Select a type of printing from the left screen. There are following printing types. Item Description Prints queue ticket numbers. Queue Ticket This is a sample program using the ePOS-Print API. Prints coupons.

This manual is also suitable for:

Tm-t70-iTm-l90-i

Table of Contents