Epos-Print XML Um en Revk
Epos-Print XML Um en Revk
User’s Manual
Overview
Describes the features and development environment.
XML Reference
Describes the ePOS-Print XML.
Appendix
M00048210
Rev.K
Cautions
• No part of this document may be reproduced, stored in a retrieval system, or transmitted in any form or
by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written
permission of Seiko Epson Corporation.
• The contents of this document are subject to change without notice. Please contact us for the latest
information.
• While every precaution has taken in the preparation of this document, Seiko Epson Corporation assumes
no responsibility for errors or omissions.
• 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 and
maintenance instructions.
• Seiko Epson Corporation shall not be liable against any damages or problems arising from the use of any
options or any consumable products other than those designated as Original Epson Products or Epson
Approved Products by Seiko Epson Corporation.
Trademarks
EPSON is a registered trademark of Seiko Epson Corporation.
Exceed Your Vision and ESC/POS are registered trademarks or trademarks of Seiko Epson Corporation.
Microsoft, Windows, Visual Studio, Silverlight and Internet Explorer are either registered trademarks or
trademarks of Microsoft Corporation in the United States and other countries.
AndroidTM and Google ChromeTM are either registered trademarks or trademarks of Google Inc. in the
United States and other countries.
Apple, Mac OS and Xcode are either registered trademarks or trademarks of Apple Inc. in the United
States and other countries.
IOS is registered trademarks or trademarks of Cisco in the United States and other countries.
Flash, FlexTM are either registered trademarks or trademarks of Adobe Systems Incorporated in the United
States and other countries.
JavaTM is a registered trademark of Oracle Corporation, its subsidiaries, and affiliates in the U.S. and other
countries.
Eclipse is a trademark or registered trademark of Eclipse Foundation, Inc.
FileMaker is a trademark of FileMaker, Inc., registered in the U.S.and other countries.
QR Code is a registered trademark of DENSO Wave Incorporated.
All other trademarks are the property of their respective owners and used for identification purpose only.
2
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.
Restriction of Use
When this product is used for applications requiring high reliability/safety such as transportation devices
related to aviation, rail, marine, automotive etc.; disaster prevention devices; various safety devices etc; or
functional/precision devices etc, you should use this product only after giving consideration to including fail-
safes and redundancies into your design to maintain safety and total system reliability. Because this product
was not intended for use in applications requiring extremely high reliability/safety such as aerospace
equipment, main communication equipment, nuclear power control equipment, or medical equipment
related to direct medical care etc, please make your own judgment on this product’s suitability after a full
evaluation.
3
About this Manual
In this manual, "ePOS-Print supported printer" is a generic term for the TM-DT series/TM-i series and TM printers
that support the ePOS-Print XML.
The TM-DT series in this manual is a generic term for the following printers.
• TM-H6000IV-DT
• TM-T70II-DT
• TM-T88V-DT
The TM-i series in this manual is a generic term for the following printers.
• TM-L90-i
• TM-T20II-i
• TM-T70-i
• TM-T82II-i
• TM-T83II-i
• TM-T88V-i
• TM-U220-i
Manual Content
The manual is made up of the following sections:
Chapter 1 Overview
Chapter 2 Sample Program (XML Print Service)
Chapter 3 Programming Guide (XML Print Service)
Chapter 4 XML Reference
Appendix ePOS-Print Editor
4
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 ........................................................................................9
■ Overview............................................................................................................................... 9
■ XML Print Service.................................................................................................................. 9
Features................................................................................................................................................... 9
Interface Type ...................................................................................................................................... 10
WSDL(Web Services Description Language) .................................................................................... 11
Print Image............................................................................................................................................ 11
Operating Environment....................................................................................................................... 12
ePOS-Print Service Versions................................................................................................................. 14
Restrictions ............................................................................................................................................ 14
■ XML Reference ................................................................................................................... 15
XML Schemas ....................................................................................................................................... 15
Namespace ......................................................................................................................................... 15
Command Type ................................................................................................................................... 16
■ Provided Article.................................................................................................................. 17
Package ............................................................................................................................................... 17
Manual .................................................................................................................................................. 17
Sample Program .................................................................................................................................. 17
Download ............................................................................................................................................. 18
5
■ Environment Settings in Other Execution Environments.................................................. 26
HTML5 (To Build a Web Server on Windows/Linux)............................................................................26
Java .......................................................................................................................................................27
Windows (Visual Basic .NET) ................................................................................................................28
Silverlight ................................................................................................................................................29
Flash .......................................................................................................................................................30
Android ..................................................................................................................................................31
Windows CE ..........................................................................................................................................33
iOS ..........................................................................................................................................................37
Windows Store Apps.............................................................................................................................38
XML Reference............................................................................. 61
■ Element List ......................................................................................................................... 61
■ Root Element....................................................................................................................... 62
<epos-print> ..........................................................................................................................................62
<response> ............................................................................................................................................63
■ Element ............................................................................................................................... 66
<text> .....................................................................................................................................................66
<feed> ...................................................................................................................................................72
<image> ................................................................................................................................................74
<logo>....................................................................................................................................................76
<barcode> ............................................................................................................................................77
<symbol> ...............................................................................................................................................81
<hline> ...................................................................................................................................................86
<vline-begin> ........................................................................................................................................87
<vline-end> ...........................................................................................................................................88
<page>..................................................................................................................................................89
<area> ...................................................................................................................................................90
<direction> ............................................................................................................................................91
6
<position>.............................................................................................................................................. 92
<line> ..................................................................................................................................................... 93
<rectangle>.......................................................................................................................................... 94
<cut> ..................................................................................................................................................... 95
<pulse>.................................................................................................................................................. 96
<sound> ................................................................................................................................................ 97
<command> ........................................................................................................................................ 99
<layout> .............................................................................................................................................. 100
<recovery>.......................................................................................................................................... 104
<reset>................................................................................................................................................. 105
■ Support Information by Printer ........................................................................................ 106
TM-H6000IV-DT .................................................................................................................................... 106
TM-L90-i/ TM-L90 ................................................................................................................................. 108
TM-P20 ................................................................................................................................................. 110
TM-P60II/ TM-P60II with Peeler ........................................................................................................... 112
TM-P80 ................................................................................................................................................. 114
TM-T20.................................................................................................................................................. 116
TM-T20II-i/ TM-T20II .............................................................................................................................. 117
TM-T70-i/ TM-T70.................................................................................................................................. 119
TM-T70-i/ TM-T70 (Multi-language model) ....................................................................................... 121
TM-T70II-DT/ TM-T70II ........................................................................................................................... 123
TM-T82II-i/ TM-T82II .............................................................................................................................. 125
TM-T83II-i/ TM-T83II .............................................................................................................................. 127
TM-T88IV .............................................................................................................................................. 129
TM-T88V-DT/ TM-T88V-i/ TM-T88V ....................................................................................................... 131
TM-T90.................................................................................................................................................. 133
TM-U220-i/ TM-U220 ............................................................................................................................ 135
Appendix....................................................................................137
■ ePOS-Print Editor............................................................................................................... 137
ePOS-Print Editor Operating Environment ....................................................................................... 137
Environment Setting Procedure........................................................................................................ 137
Setting ................................................................................................................................................. 139
Creating a Sample Code ................................................................................................................. 140
Encoding Graphic Data ................................................................................................................... 145
7
8
Chapter 1 Overview
Overview
This chapter describes the features of and the specifications for ePOS-Print.
Overview
ePOS-Print is an Epson's unique printing function that uses XML and Web Service.
This function creates request messages in XML format using the application on devices such as computers,
smart phones, and tablets, and performs printing to a TM printer on the network using Web Service.
This document is made up of the following sections:
XML Print Service (p.9)
1
XML Reference (p.15)
For details about the provided articles, refer to Provided Article (p.17).
Print data can be created in ePOS-Print XML format also with Server Direct Print. For details, refer to XML
Reference (p.61).
(Request)
ePOS-Print supported TM printer
Application
ePOS-Print Service
(Response)
Features
❏ Allows printing from SOAP/HTTP-supported devices. Not OS-dependent.
❏ Installation of drivers and plug-ins is not required.
❏ No computers or servers are required for printing.
❏ In case of TM-DT series/TM-i series, it can print to other TM printer via TM intelligent printer.
❏ Automatically checks the status of the TM printer before printing. There is no need for checking the status
of the TM printer in advance.
❏ Does not respond to a printer's function to automatically send its status (Auto Status Back). Instead,
capable of sending an empty print command and checking the status of the TM printer based on the
result of command transmission.
❏ To change the printer settings, utility programs dedicated to each printer or other utility programs should
be used.
❏ Capable of obtaining the printer status even when the printer is offline.
9
Interface Type
❏ SOAP/HTTP Interface (p.10)
❏ SOAP/HTTP Interface (WSDL supported) (p.10)
❏ Interface for FileMaker (p.11)
SOAP/HTTP Interface
When a print document is sent from an application to ePOS-Print Service using SOAP/HTTP, ePOS-Print
Service performs printing and returns a response document.
Specification
Item Description
End point address http://[IP address of the ePOS-Print supported TM printer]/cgi-bin/epos/
service.cgi?devid=[device ID]&timeout=[timeout time]
Request message A SOAP message is sent against a HTTP POST method request.
One print document is specified in the SOAP body.
Response message A SOAP message is returned against a HTTP POST method response.
A response document is put in the SOAP body.
Specification
Item Description
End point address http://[IP address of the ePOS-Print supported TM printer]/cgi-bin/epos/
service.cgi
Request message A SOAP message is sent against a HTTP POST method request.
In the SOAP header, the device ID, timeout time, and job ID can be specified.
One print document is specified in the SOAP body.
Response message A SOAP message is returned against a HTTP POST method response.
A device ID and a job ID are put in the SOAP header.
A response document is put in the SOAP body.
10
Chapter 1 Overview
Specification
Item Description
End point address httppost://[IP address of the ePOS-Print supported TM printer]/cgi-bin/epos/
service.cgi?printdata=[SOAP message]
Request message A SOAP message is sent against a request in the HTTP POST function of
FileMaker. In the SOAP header, the device ID, timeout time, and job ID can be
1
specified. One print document is specified in the SOAP body.
Response message A SOAP message is returned against a response in the HTTP POST function of
FileMaker. A device ID and a job ID are put in the SOAP header.
A response document is put in the SOAP body.
Print Image
Print text
11
Operating Environment
Application Environment
An environment in which HTTP communication is possible and XML documents can be handled
❏ OS (Example: iOS/ AndroidTM/ Windows CE/ Windows/ Linux/ Mac OS, etc.)
❏ HTML5-supported browser, Flex, Silverlight
❏ Java, .NET Framework
Device
A device capable of HTTP communication by connecting to the network.
(Example: smart phones, tablet terminals, computers, etc.)
Development Environment
An editor program capable of editing XML documents.
(Example: Visual Studio/Eclipse, etc.)
TM-DT Series
❏ TM-H6000IV-DT (Receipt printer only)
❏ TM-T70II-DT
❏ TM-T88V-DT
TM-i Series
❏ TM-L90-i
❏ TM-T20II-i
❏ TM-T70-i
❏ TM-T82II-i
❏ TM-T83II-i
❏ TM-T88V-i
❏ TM-U220-i
12
Chapter 1 Overview
TM Printer
❏ Following printers with the UB-R04 embedded
TM-T20
TM-T20II
TM-L90
TM-T70
TM-T70II
TM-T82II
TM-T83II
TM-T88IV
TM-T88V
TM-T90
1
TM-U220
❏ TM-P20 (Wi-Fimodel)
❏ TM-P60II (Wi-Fi model)
❏ TM-P60II with Peeler (Wi-Fi model)
❏ TM-P80 (Wi-Fi model)
ePOS-Print in the TM printer must be turned to "Enable". It is set to "Disable" by factory default.
You cannot control ePOS-Print if it is disabled. For details, refer to Support Information by
Printer (p.106).
Printer Functions
Depending on the printer type and TM-DT software/TM-i firmware version being used, the functions you can
use with ePOS-Print XML differ. For details, see the following.
* Available TM printers are different depending on the TM-DT software version installed in the product.
For details, refer to Technical Reference Guide for each printer.
13
ePOS-Print Service Versions
The ePOS-Print Service version is supported as follows.
If XML element of newly added is used on unsupported models, schema error is returned and
printing cannot be done. The latest version of the XML Schema is recommended regardless of
ePOS-Print Service version installed on a printer. XML Schema is bundled with the sample
program.For details, refer to Provided Article (p.17).
Restrictions
❏ The drawer and the buzzer cannot be used together.
❏ The buzzer function cannot be used if the printer is not provided with the buzzer.
❏ When multiple tones are set for raster images, intermitting printing may occur because the amount of
data to print increases and white stripes may appear in the print result.
❏ The scan quality of barcodes/2D-codes printed as multiple-tone raster images cannot be guaranteed.
Print them as two-tone images.
❏ If printing was cancelled, perform the following settings to clear the data left in the printer.
(in ePOS-Print Service Ver.3.0 and later)
In the printer DIP switches (memory switches), configure the Busy condition only for the receive buffer
full.
Disable the command execution (offline). (TM-P60II, TM-P80)
14
Chapter 1 Overview
XML Reference
ePOS-Print XML is a POS printer command system that defines the major features of the ESC/POS command
system using XML.
XML Schemas
The ePOS-Print XML syntax is defined by W3C XML Schemas.
XML schemas help applications strictly validate XML documents using the XML API of the operating
environment. In addition, application developers can efficiently create XML documents using the XML
document editing support function of the integrated development environment.
File name : epos-print-4.x.x.xsd
1
Namespace
The ePOS-Print XML namespaces and namespace identifiers used in this document are shown as follows:
Identifier Namespace
(Default) http://www.epson-pos.com/schemas/2011/03/epos-print
tns http://www.epson-pos.com/schemas/2011/03/epos-print
xs http://www.w3.org/2001/XMLSchema
15
Command Type
The installed functions vary depending on the model. For details, refer to Support Information by
Printer (p.106).
Item Description
Common Alignment, Rotation, Line Spacing, Page mode
Character ANK
Character style Font, Smoothing, Double-width, Double-height , Horizontal scale,
Vertical scale, White/Black Reverse, Underline, Emphasized Color,
Print position
Paper feed By Unit, By Line
Raster image Mono, Multiple-tone
NV logo Mono, Multiple-tone
Barcode UPC-A, UPC-E, EAN13(JAN13), EAN8(JAN13), CODE39,
ITF,CODABAR(NW-7), CODE93, CODE128, GS1-128, GS1 DataBar
2D-Code PDF417, QR Code, MaxiCode, GS1 DataBar, Aztec Code, DataMatrix
Line 6 types
Paper cut No Feed, Feed Cut, Cut Reservation
Drawer Kick-out Connector, ON Time
Buzzer 7 or 10 Pattern, Repeat
Layout Paper layout setting
Command ESC/POS insertion
Response Print result, Error code, Status
Recovery from an error Recovery from errors that can be recovered from, Buffer clear
Reset Printer reset
16
Chapter 1 Overview
Provided Article
Package
Manual
1
❏ ePOS-Print XML User’s Manual (This Document)
❏ TM-H6000IV-DT Technical Reference Guide
❏ TM-T70II-DT Technical Reference Guide
❏ TM-T88V-DT Technical Reference Guide
❏ TM-L90-i Technical Reference Guide
❏ TM-P20 Technical Reference Guide
❏ TM-P60II Technical Reference Guide
❏ TM-P80 Technical Reference Guide
❏ TM-T20II-i Technical Reference Guide
❏ TM-T70-i (TM-i firmware Ver.4 or later) Technical Reference Guide
❏ TM-T70-i (TM-i firmware Ver.3.x or earlier) Technical Reference Guide
❏ TM-T82II-i Technical Reference Guide
❏ TM-T83II-i Technical Reference Guide
❏ TM-T88V-i (TM-i firmware Ver.4 or later) Technical Reference Guide
❏ TM-T88V-i (TM-i firmware Ver.3.x or earlier) Technical Reference Guide
❏ TM-U220-i Technical Reference Guide
❏ UB-R04 Technical Reference Guide
❏ Each TM printer Technical Reference Guide
Sample Program
ePOS-Print_Sample_XML_V4.x.xE.zip
Contains the following:
❏ epos-print-4.x.x.wsdl (ePOS-Print XML Print Service)
❏ epos-print-4.x.x.xsd (ePOS-Print XML schemas)
❏ Sample program
(HTML5/ Java/ Windows/ Silverlight/ Flash/Android/ iOS/ Windows CE)
❏ editor/index.html (ePOS-Print Editor)
17
Download
For customers in North America, go to the following web site:
http://www.epsonexpert.com/ and follow the on-screen instructions.
For customers in other countries, go to the following web site:
https://download.epson-biz.com/?service=pos
18
Chapter 2 Sample Program (XML Print Service)
In this chapter, descriptions are made mainly based on a HTML5 environment. For an
environment other than the above, read such descriptions in ways that suit the relevant
environment.
Overview
Print text
19
Environment
This section describes the following system: the device's HTML 5-supported browser accesses the sample
program uploaded to Web server and then printing is performed. For use in other environments, see
"Environment Settings in Other Execution Environments" on page 26.
The following environments are provided for the sample program:
20
Chapter 2 Sample Program (XML Print Service)
Operating Environment
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
[192.168.192.10]
Wireless
2
Network
❏ Web server
(Used for HTML5, Silverlight, and Flash sample programs.)
❏ Wireless LAN Router
❏ ePOS-Print supported TM printer (1 set)
❏ Terminal with an HTML5-supported Web browser
21
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.
4. Terminal settings
Configure the wireless LAN (Wi-Fi) settings of the terminal to match the router settings so as to
enable network connection. For details, refer to the manual for the device you are using.
22
Chapter 2 Sample Program (XML Print Service)
ePOS-Print Settings
❏ TM-DT Series
For details, refer to the Technical Reference Guide for each TM-DT Series printer.
❏ TM-i Series
For details, refer to the Technical Reference Guide for each TM-i Series printer.
❏ TM Printer (Wireless LAN Model)
Configure the settings via the network. USB connection cannot be used for setting.
Item Setting
Set to Enable.
ePOS-Print
(Default: Disabled)
Align with the system settings.
Device ID
(Default: local_printer)
Set in line with the connected TM printer.
Printing Method
(For details, see "Support Information by Printer" (p.106)).
Align with the connected TM printer and set the TM printer's
Character Code Table code page. (For details, see "Support Information by Printer"
(p.106) "ePOS-Print Settings").
23
For mobile printer (Wireless LAN Model)
Item Setting
Set to Enable.
ePOS-Print
(Default: Disabled)
Align with the system settings.
Device ID
(Default: local_printer)
4 Click [Send].
24
Chapter 2 Sample Program (XML Print Service)
1 Expand HtmlApplication1.zip.
3 Change the source code portion "// URL of ePOS-Print supported TM printer" in the
source file to the IP address of ePOS-Print supported TM printer and the save the
source file.
2
Registering the Sample Program
Register the sample program into the Web server.
• To use TM-DT as the Web server, refer to Technical Reference Guide for each TM-DT.
• To use TM-i as the Web server, refer to Technical Reference Guide for each TM-i.
Register as follows:
25
Environment Settings in Other Execution Environments
This section describes the setting operation in a development environment up to sample program
execution.
❏ HTML5 (To Build a Web Server on Windows/Linux) (p. 26)
❏ Java (p. 27)
❏ Windows (Visual Basic .NET) (p. 28)
❏ Silverlight (p. 29)
❏ Flash (p. 30)
❏ Android (p. 31)
❏ Windows CE (p. 33)
❏ iOS (p. 37)
❏ Windows Store Apps (p. 38)
Item Description
Development environment Microsoft Visual Studio 2010
(example)
Required item IIS (Internet Information Services) or Apache
Sample program file name HtmlApplication1.zip
Edit the IP address of ePOS-Print supported TM printer to suit the
network environment.
<Default value>
TM-DT:
Wireless LAN: Automatically acquired by DHCP
Source editing
(192.168.192.168 if it cannot be automatically acquired)
Wired LAN: 192.168.192.168
TM-i: Automatically acquired by DHCP
(192.168.192.168 if it cannot be automatically acquired)
TM Printer: 192.168.192.168
1 Install IIS.
2 Configure your computer and ePOS-Print supported TM printer so that they can
connect to the network.
3 Extract the sample program and copy the extracted sample program files into the
root folder of IIS.
System drive : \Inetpub\wwwroot
26
Chapter 2 Sample Program (XML Print Service)
Java
Item Description
Development environment Eclipse
(example)
Required item Java SE Development Kit 6
Sample program file name JavaProject1.zip
Edit the IP address of ePOS-Print supported TM printer to suit the
network environment.
<Default value>
TM-DT:
Wireless LAN: Automatically acquired by DHCP
Source editing
(192.168.192.168 if it cannot be automatically acquired)
Wired LAN: 192.168.192.168
TM-i: Automatically acquired by DHCP
(192.168.192.168 if it cannot be automatically acquired)
TM Printer: 192.168.192.168
2
Environment Setting Procedure
2 Configure your computer and ePOS-Print supported TM printer so that they can
connect to the network.
27
Windows (Visual Basic .NET)
Item Description
Development environment Microsoft Visual Studio 2010
(example)
Required item -
Sample program file name WindowsApplication1.zip
Edit the IP address of ePOS-Print supported TM printer to suit the
network environment.
<Default value>
TM-DT:
Wireless LAN: Automatically acquired by DHCP
Source editing
(192.168.192.168 if it cannot be automatically acquired)
Wired LAN: 192.168.192.168
TM-i: Automatically acquired by DHCP
(192.168.192.168 if it cannot be automatically acquired)
TM Printer: 192.168.192.168
1 Configure your computer and ePOS-Print supported TM printer so that they can
connect to the network.
28
Chapter 2 Sample Program (XML Print Service)
Silverlight
Item Description
Development environment Microsoft Visual Studio 2010
(example)
Required item Microsoft Silverlight 4 Tools for Visual Studio 2010
Sample program file name SilverlightApplication1.zip, crossdomain.zip
Edit the IP address of ePOS-Print supported TM printer to suit the
network environment.
<Default value>
TM-DT:
Wireless LAN: Automatically acquired by DHCP
Source editing
(192.168.192.168 if it cannot be automatically acquired)
Wired LAN: 192.168.192.168
TM-i: Automatically acquired by DHCP
(192.168.192.168 if it cannot be automatically acquired)
TM Printer: 192.168.192.168
2
Environment Setting Procedure
When using by registering the Web server of TM intelligent printer, it is necessary to register cross
domain policy file (crossdomain.zip). For detail information on registration method, refer to
Technical Reference Guide for each printer.
2 Configure your computer and ePOS-Print supported TM printer so that they can
connect to the network.
29
Flash
Item Description
Development environment Flash Builder 4.5 or later
Required item Flash Builder 4.5 or later
Sample program file name FlexProject1.zip, crossdomain.zip
Edit the IP address of ePOS-Print supported TM printer to suit the
network environment.
<Default value>
TM-DT:
Wireless LAN: Automatically acquired by DHCP
Source editing
(192.168.192.168 if it cannot be automatically acquired)
Wired LAN: 192.168.192.168
TM-i: Automatically acquired by DHCP
(192.168.192.168 if it cannot be automatically acquired)
TM Printer: 192.168.192.168
When using by registering the Web server of TM intelligent printer, it is necessary to register cross
domain policy file (crossdomain.zip). For detail information on registration method, refer to
Technical Reference Guide for each printer.
2 Configure your computer and ePOS-Print supported TM printer so that they can
connect to the network.
4 Start Adobe Flash Builder and read the sample program project.
30
Chapter 2 Sample Program (XML Print Service)
Android
Item Description
Development environment Eclipse
Required item Android SDK 1.5
Java SE Development Kit 6
ADT (Android Development Tools) Plug-in for Eclipse
Sample program file name AndroidProject1.zip
Edit the IP address of ePOS-Print supported TM printer to suit the
network environment.
<Default value>
TM-DT:
Wireless LAN: Automatically acquired by DHCP
Source editing
(192.168.192.168 if it cannot be automatically acquired)
Wired LAN: 192.168.192.168
TM-i: Automatically acquired by DHCP
(192.168.192.168 if it cannot be automatically acquired)
2
TM Printer: 192.168.192.168
3 Start Android SDK Manager and install the Android 1.5(API3) package.
7 Configure your computer and ePOS-Print supported TM printer so that they can
connect to the network.
31
Creating Android Virtual Device
1 Start Eclipse.
3 The "Android SDK and AVD Manager" screen appears. Select the [New] button.
4 On [Create new Android Virtual Device], type the name. Alternatively, select the
device to use and create a new entry.
1 Start Eclipse.
4 Enter values in the [Name] and [Location] fields and click the [OK] button.
Item Description
Name Enter any name.
Location Enter [https://dl-ssl.google.com/android/eclipse/].
5 Return to the "Install" screen. Tick [Developer Tools] and click the [Next] button.
1 Start Eclipse.
2 Select as [Windows]-[Configuration].
5 Select the [Android - Android SDK] directory and click the [OK] button.
32
Chapter 2 Sample Program (XML Print Service)
Windows CE
Item Description
Development environment Microsoft Visual Studio 2008 SP1
Required item Windows Embedded Compact 7
Virtual PC 2007
Sample program file name SmartDeviceProject1.zip
Edit the IP address of ePOS-Print supported TM printer to suit the
network environment.
<Default value>
TM-DT:
Wireless LAN: Automatically acquired by DHCP
Source editing
(192.168.192.168 if it cannot be automatically acquired)
Wired LAN: 192.168.192.168
TM-i: Automatically acquired by DHCP
(192.168.192.168 if it cannot be automatically acquired)
TM Printer: 192.168.192.168
2
Environment Setting Procedure
4 Configure your computer and ePOS-Print supported TM printer so that they can
connect to the network.
33
8 The Device Emulator starts. In the Device Emulator, select as [File]-[Configure...]-
[Network].
34
Chapter 2 Sample Program (XML Print Service)
35
12 Incard
the Device Emulator, select [The Internet] and then select the same network
as that of your computer.
13 Set the IP address and click [OK] at the top right of the screen.
36
Chapter 2 Sample Program (XML Print Service)
iOS
Item Description
OS Mac OS X 10.6.8
Development environment Apple Xcode 3.2.6
SDK iOS SDK 4.3
Sample program file name iOSDeviceProject1.zip
Edit the IP address of ePOS-Print supported TM printer to suit the
network environment.
<Default value>
TM-DT:
Wireless LAN: Automatically acquired by DHCP
Source editing
(192.168.192.168 if it cannot be automatically acquired)
Wired LAN: 192.168.192.168
TM-i: Automatically acquired by DHCP
(192.168.192.168 if it cannot be automatically acquired)
TM Printer: 192.168.192.168
2
Execution The sample program can be checked using iOS Simulator.
1 Expand iOSDeviceProject1.zip.
3 When the project is opened, the project settings and source files will be displayed.
4 From the options displayed when [Set Active Executable] is selected, select an
iPhone or iPad file.
37
Windows Store Apps
Item Description
OS Microsoft Visual Studio 2012
Required item Windows 8
Sample program file name App1.zip
Edit the IP address of ePOS-Print supported TM printer to suit the
network environment.
<Default value>
TM-DT:
Wireless LAN: Automatically acquired by DHCP
Source editing
(192.168.192.168 if it cannot be automatically acquired)
Wired LAN: 192.168.192.168
TM-i: Automatically acquired by DHCP
(192.168.192.168 if it cannot be automatically acquired)
TM Printer: 192.168.192.168
1 Configure your computer and ePOS-Print supported TM printer so that they can
connect to the network.
38
Chapter 3 Programming Guide (XML Print Service)
This section describes specific procedures using Visual Studio (p. 39) and Eclipse (p. 42) as
examples.
Visual Studio
Setting Procedure
39
3 Set the XML schema "epos-print-4.x.x.xsd" to the XML file.
[XML]-[Schemas...]-[Add...]
Editing Example
1 Enter the character "<" in the XML file. Then, root element candidates appear.
2 Select "epos-print" from the candidates and enter the character ">". Then, the
epos-print root element is added.
3 Start a new line and enter the character "<". Then, element candidates appear.
40
Chapter 3 Programming Guide (XML Print Service)
4 Select "text" from the candidates and enter an empty space. Then, attribute
candidates appear.
5 Select "lang" from the candidates. Then, attribute value candidates appear.
6 Select "en" from the candidates and enter the character ">". Then, the text
element is added.
7 Enter a character string to print for the content of the text element.
41
Eclipse
Setting Procedure
Create an XML file and set the location of the schema using URL as follows:
<text lang='en'>Hello </text>
</epos-print>
42
Chapter 3 Programming Guide (XML Print Service)
ePOS-Print XML
In this chapter, descriptions are made mainly based on a HTML5 environment. For an
environment other than the above, read such descriptions in ways that suit the relevant
environment.
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. This mode is suitable for the type of printing such as printing
receipts that requires the paper length to change according to the print space.
Page mode
In page mode, you set a print area, lay out data in it, and print the data in a batch operation. Characters,
images, and barcodes are laid out in the print positions (coordinates).
Programming Flow
3
For the ePOS-Print XML, programming is performed based on the following work flow:
To ensure successful print operation, write a program in such a way that data is sent after
checking the printer status. For the above procedure, refer to Checking the Printer Status (p.53).
43
Print Document Creation
Create a print document using elements in the epos-print root element. For details on elements, refer to
Element List (p.61).
Refer to the following program for print document creation.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>TITLE</title>
<script type="text/javascript">
function createDocument() {
//Start print document creation.
var request = '<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">';
//Create a print document
request += '<text lang="en" smooth="true"/>';
request += '<text font="font_a"/>';
request += '<text width="3" height="3">Hello, World! </text>';
request += '<cut type="feed"/>';
//End print document creation.
request += '</epos-print>';
}
</script>
</head> Create a print document
<body>
</body>
</html>
44
Chapter 3 Programming Guide (XML Print Service)
For the string "Hello World!", to create a print document based on the following settings:
❏ Font: FontA
❏ Scale: x 4 (horizontal) and x 4 (vertical)
❏ Style: Bold
<script type="text/javascript">
function createDocument() {
//Start print document creation.
var request = '<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/
epos-print">';
//Create a print document
//<Configure the print character settings>
request += '<text lang="en"/>';
request += '<text smooth="true"/>';
request += '<text font="font_a"/>';
request += '<text width="4" height="4"/>';
request += '<text em="true"/>';
//<Specify the character string to print>
request += '<text>Hello, World! </text>';
//<Specify the feed cut>
3
request += '<cut type="feed"/>';
//End print document creation.
request += '</epos-print>';
}
</script>
Print image
45
To create a graphic print document:
Create a graphic print document using the image element in the epos-print root element. Set the image
size using an attribute of the image element. For graphics, specify raster graphic bit-image data using a
base 64 encoded character string.
Refer to the following program for print document creation.
<script type="text/javascript">
function createDocument() {
//Start print document creation.
var request = '<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/
epos-print">';
//Create a print document
//<Specify the raster image>
request += '<image width="8" height="48">8PDw8A8PDw/w8PDwDw8PD/
Dw8PAPDw8P8PDw8A8PDw/w8PDwDw8PD/Dw8PAPDw8P</image>';
//<Specify the feed cut>
request += '<cut type="feed"/>';
//End print document creation.
request += '</epos-print>';
}
</script>
• This section describes how to print a raster image. In addition, there is also a method of printing
graphics registered in the NV memory of the printer. For details, refer to <logo> (p.76).
• For details on how to create raster images, refer to Encoding Graphic Data (p.145).
Print image
46
Chapter 3 Programming Guide (XML Print Service)
For the string "Hello World!", to create a print document based on the following settings:
❏ Page mode print area (in dots)
Origin of horizontal axis: 100, origin of vertical axis: 50, width: 200, height: 100
❏ Page mode print positions (in dots)
Horizontal print position: 0, vertical print position: 42
❏ Font: FontA
❏ Scale: x 2 (horizontal) and x 2 (vertical)
❏ Style: Bold
<script type="text/javascript">
function createDocument() {
//Start print document creation.
var request = '<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/
epos-print">';
//Create a print document
//<The page mode starts>
request += '<page>';
//<Specify the page mode print area>
request += '<area x="100" y="50" width="200" height="100"/>';
3
//<Specify the page mode print position>
request += '<position x="0" y="42"/>';
//<Set print text>
request += '<text lang="en"/>';
request += '<text smooth="true"/>';
request += '<text font="font_a"/>';
request += '<text width="2" height="2"/>';
request += '<text em="true"/>';
//<Specify the character string to print>
request += '<text>Hello,</text>';
request += '<position x="0" y="96"/>';
request += '<text>World!</text>';
//<The page mode ends>
request += '</page>';
//<Specify the feed cut>
request += '<cut type="feed"/>';
//End print document creation.
request += '</epos-print>';
}
</script>
Print image
47
Transmission of Print Document
A print document is sent using an ePOS-Print object.
Create an ePOS-Print object using the constructor and specify the end point address for the printer to be
used for printing as well as the print document into the send method to send the document.
For the details about the printer end point address, refer to Printer End Point Address (p.50).
Refer to the following program.
ePOS-Print supported TM printer checks the status of the TM printer used for printing and then
start printing operation.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>TITLE</title>
<script type="text/javascript">
function sendDocument() {
//Create a print document
var request = '<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">';
request += '<text lang="en" smooth="true"/>';
request += '<text font="font_a"/>';
request += '<text width="3" height="3">Hello, World! </text>';
request += '<cut type="feed"/>';
request += '</epos-print>';
48
Chapter 3 Programming Guide (XML Print Service)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>TITLE</title>
<script type="text/javascript">
function sendDocument() {
//Create a print document
var request = '<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">';
request += '<text lang="en" smooth="true"/>';
request += '<text font="font_a"/>';
request += '<text width="3" height="3">Hello, World! </text>';
request += '<cut type="feed"/>';
request += '</epos-print>';
49
Printer End Point Address
Specify the printer end point address in the following format:
For SOAP/HTTP Interface (WSDL supported), the device ID and timeout time are specified in
the SOAP header.
50
Chapter 3 Programming Guide (XML Print Service)
The printer status can be obtained when communication with the printer is possible.
Refer to the following program. For the details about how to program a callback function in detail, refer to
Error handling (p.52).
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>TITLE</title>
<script type="text/javascript">
function sendDocument() {
//Create a print document
var request = '<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">';
request += '<text lang="en" smooth="true"/>';
request += '<text font="font_a"/>';
request += '<text width="3" height="3">Hello, World! </text>';
3
request += '<cut type="feed"/>';
request += '</epos-print>';
51
Error handling
Refer to the following program for the error handling method by a callback function.
52
Chapter 3 Programming Guide (XML Print Service)
}
}
alert('Success');
3
}
};
53
Specifying the Print Job ID from the Application
A response containing the specified print job ID will be returned when sending a request from the
application by specifying the print job ID. (ePOS-Print Service Ver.4.1 or later versions)
Job ID : ABC123
Job ID : ABC123
Print data
Response data
Programming Example
Request
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<parameter xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<devid>local_printer</devid>
<timeout>60000</timeout>
<printjobid>ABC123</printjobid>
</parameter>
</s:Header>
<s:Body>
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<text>Hello, World! </text>
<cut />
</epos-print>
</s:Body>
</s:Envelope>
Response
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<parameter xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<devid>local_printer</devid>
<timeout>60000</timeout>
<printjobid>ABC123</printjobid>
</parameter>
</s:Header>
<s:Body>
<response xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print"
success="true" code="" status="252641302" battery="0" />
</s:Body>
</s:Envelope>
54
Chapter 3 Programming Guide (XML Print Service)
1 : Request message()
1.1 : Cmd()
1.1.1 : Print()
The print data job will be added to the queue and a response will be returned to the application without
waiting for printing to complete when sending a printing request to ePOS-Print Service I/F from the
application when the spooler function is enabled.
Even if the output printer cannot complete the printing task, ePOS-Print Service I/F does not return an error
3
to the application. If print forwarding is enabled, printing from a substitute printer is available.
The application can obtain the print result later by requesting an empty print data with the print job ID
specified. Refer to the sequence diagram below.
1 : Request message
(Print data,
printjobid="ABC123")
1.1 : send()
55
Programming Example
Printing Process
Request
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<parameter xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<devid>local_printer</devid>
<timeout>60000</timeout>
<printjobid>ABC123</printjobid>
</parameter>
</s:Header>
<s:Body>
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<text>Hello, World! </text>
<cut />
</epos-print>
</s:Body>
</s:Envelope>
Response
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<parameter xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<devid>local_printer</devid>
<printjobid>ABC123</printjobid>
</parameter>
</s:Header>
<s:Body>
<response xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print"
success="true" code="" status="2" battery="0" />
</s:Body>
</s:Envelope>
• The TM intelligent printer will issue a print job ID if the print job ID is not specified by the
application.
• As the printing process has not been performed at this time, success will be set to "true," code
to "" (left empty), status to 0x00000002 or 0x80000000 and battery to "0".
56
Chapter 3 Programming Guide (XML Print Service)
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<parameter xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<printjobid>ABC123</printjobid>
</parameter>
</s:Header>
<s:Body>
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print" />
</s:Body>
</s:Envelope>
Empty print data is sent when requesting the acquisition of the print job status.
As such, child elements of the <epos-print> element are not specified.
Response
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<parameter xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<printjobid>ABC123</printjobid>
3
</parameter>
</s:Header>
<s:Body>
<response xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print"
success="true" code="" status="252641302" battery="0" />
</s:Body>
</s:Envelope>
57
Printing in Other Environments
This section describes how to generate client codes (proxy class) from WSDL by using the tool provided in
the development environment.
.NET Framework
Item Description
Tool ServiceModel Metadata Utility Tool (Svcutil.exe)
Command > svcutil.exe epos-print-4.x.x.wsdl epos-print-4.x.x.xsd
For details about the Svcutil.exe tool, refer to the following Web site (as of October, 2014):
http://msdn.microsoft.com/en-us/library/aa347733.aspx
Procedure
1 From the command prompt, execute Svcutil.exe and create the following files:
ePOSPrint.cs (WCF contract)
output.config (application configuration file)
58
Chapter 3 Programming Guide (XML Print Service)
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
ePOSPrintPortTypeClient client = new ePOSPrintPortTypeClient();
59
Java
Item Description
Tool JAX-WS wsimport tool
Command > wsimport epos-print-4.1.0.wsdl
For details about the JAX-WS wsimport tool, refer to following Web site (as of October, 2014):
http://docs.oracle.com/javase/8/docs/technotes/tools/unix/wsimport.html
http://docs.oracle.com/javase/8/docs/technotes/tools/windows/wsimport.html
60
Chapter 4 XML Reference
XML Reference
This chapter describes Command Reference for ePOS-Print XML print documents.
For differences in specifications according to printer type, refer to Support Information by Printer
(p.106).
Element List
Root Standard Page
Element Function Page
element mode mode
<epos-print> Request ● ● p. 62
<text> Prints text ● ● p. 66
<feed> Paper feed ● ● p. 72
<image> Prints raster image ● ● p. 74
<logo> Prints NV logo ● ● p. 76
<barcode> Prints barcode ● ● p. 77
<symbol> Prints symbol ● ● p. 81
<hline> Prints horizontal line ● - p. 86
<vline-begin> Starts vertical line ● - p. 87
<vline-end> Ends vertical line ● - p. 88
<page> Page mode ● - p. 89
<area>
<direction>
Sets a page mode print area
Sets a page mode print direction
-
-
●
●
p. 90
p. 91 4
<position> Sets a page mode print position - ● p. 92
<line> Draws a page mode line - ● p. 93
<rectangle> Draws a page mode rectangle - ● p. 94
<cut> Paper cut ● - p. 95
<pulse> Drawer kick-out ● - p. 96
<sound> Sounds a buzzer ● - p. 97
<command> Inserts a command ● ● p. 97
<layout> *1 Setting of paper layout ● - p. 100
<recovery> *2 Recovers from an error ● - p. 104
<reset> *2 Resets the printer ● - p. 105
<response> Response ● ● p. 63
61
Root Element
<epos-print>
An XML document to be sent from a host to a printer.
This document requests the printer to execute the specified function and performs initialization when
printing starts.
<epos-print> has elements. Refer to Element List (p. 61).
Attribute
force : (data type xs:boolean)
This is the forced transmission mode. (in ePOS-Print Service Ver.3.0 and later)
If you enable forced transmission mode, print commands are forcibly sent to the printer.
Example
62
Chapter 4 XML Reference
<response>
An XML document, a printer returns to a host as a response.
This document sends the printer status after command execution.
Attribute
success : (data type xs:boolean)
Obtains the print result.
63
status : (data type xs:unsignedInt)
Obtains the printer status.
Remaining battery
64
Chapter 4 XML Reference
Example
<response xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print"
success="false" code="EPTR_REC_EMPTY" status="252641308"
battery="0" />
<response xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print"
success="false" code="EPTR_BATTERY_LOW"
status="251658268" battery="12592" />
65
Element
<text>
Prints a character string. Also, configure the string-related settings such as style, print position, and line feed
space.
• After printing text, to print content other than text content, execute line feed or paper feed.
• In page mode, characters are laid out in the current print position with the reference point being
the character baseline dot (Support Information by Printer (p.106)).
Entity Reference
To write symbols required for printer control such as horizontal tab, line feed, and the following symbols, use
their corresponding entity references shown as follows:
66
Chapter 4 XML Reference
Attribute
lang : (data type xs:language)
Specifies the target language.
*
above
English(ANK)
67
font : (data type tns:font)
Specifies the character font.
When the double-sized width attribute and the width attribute are specified in one element
at the same time, priority is given to the scale specification for the width attribute.
When the double-sized height attribute and the height attribute are specified in one
element at the same time, priority is given to the scale specification for the height attribute.
When the double-sized width attribute and the width attribute are specified in one element
at the same time, priority is given to the scale specification for the width attribute.
68
Chapter 4 XML Reference
When the double-sized height attribute and the height attribute are specified in one
element at the same time, priority is given to the scale specification for the height attribute.
69
y: (data type xs:unsignedShort Default : 21)
Specifies the vertical print start position of the text in dots. (in ePOS-Print Service Ver.3.0
and later)
In page mode, the specification is the same as the specification for the vertical print
position by the osition element, but the print position in the vertical direction only will be
moved.
• For the standard mode, specify the align attribute "when at the start of a line".
• The align attribute set in this element also applies to the align attribute in each of the
image, logo, barcode, and symbol elements.
70
Chapter 4 XML Reference
Example
Item Setting
Language English
Smoothing Enable
Align Center Align
Font Font A
Double-sizing Double width and height characters
Underline Enable
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<text lang="en" />
<text smooth="true" />
<text align="center" />
<text font="font_a" />
<text dw="true" dh="true" />
<text ul="true" />
<text>Hello, World! </text>
</epos-print>
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<text lang="ko" />
</epos-print>
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
4
<text lang="zh-hans" />
</epos-print>
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<text lang="zh-hant" />
</epos-print>
71
<feed>
Feeds paper. Specifies the paper feed amount in dots or in lines. When no paper feed amount is specified,
performs single-line paper feed (line feed). In addition, the per-line line feed space can be set.
Attribute
unit : (data type xs:unsignedByte)
Specifies the paper feed amount in dots.
line : (data type xs:unsignedByte)
Specifies the paper feed amount in lines.
linespc : (data type xs:unsignedByte, Default : 30)
Specifies the per-line paper feed amount in dots.
pos : (data type tns:feed-pos)
It specifies paper feed position of label paper/black mark paper (in ePOS-Print Service
Ver.2.1 and later).
• Control of label paper/black mark paper must be done in the standard mode.
In the page mode, pos cannot be specified.
• When the per-line paper feed amount is 30 dots, up to 240 lines can be specified.
• The standard mode retains the line feed space separate from the line feed space retained by
the page mode. When the linespc attribute is specified in this element, it will affect the
linespc attribute in each of the <text> and <feed> elements that follow.
72
Chapter 4 XML Reference
Example
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<feed line="3" />
</epos-print>
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<text>Hello</text><feed />
<text>World</text><feed />
</epos-print>
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<feed pos="current_tof" />
<barcode type="code39" hri="below">0001</barcode>
<feed pos="peeling" />
</epos-print>
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<feed pos="current_tof" />
<barcode type="code39" hri="below">0001</barcode>
4
<feed pos="next_tof" />
<barcode type="code39" hri="below">0002</barcode>
<feed pos="next_tof" />
<barcode type="code39" hri="below">0003</barcode>
<feed pos="next_tof" />
</epos-print>
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<feed pos="current_tof" />
<barcode type="code39" hri="below">0001</barcode>
<feed pos="cutting" />
<cut type="no_feed" />
</epos-print>
73
<image>
Print a raster graphic bit-image. (Data type xs:base64Binary)
Raster graphics refer to data generated by horizontally scanning the pixels of an image from the top left
corner of that image as the origin point.
Data is generated based on 1 bit per pixel for two-tone images, and 4 bits per pixel for 16-tone images,
starting with the upper bits of byte data. And zero-padding is performed so that scan data per line can be
treated on a byte basis.
• In page mode, a raster image is laid out in the current print position with the reference point
being its bottom left dot. The print position will not move.
• In page mode, set the print position so that a raster image does not extend beyond the print
area.
• Multiple tone printing is not supported in Page Mode. Multiple tone graphic printing is supported
in Standard Mode only.
• When multiple tones are set for raster images, intermitting printing may occur because the
amount of data to print increases and white stripes may appear in the print result.
• The scan quality of barcodes/2D-codes printed as multiple-tone raster images cannot be
guaranteed. Print them as two-tone images.
• To print a raster image at high speed, specify "left" for the align attribute and specify a multiple
of 8 that does not exceed the printer paper width for the width attribute value.
• To create raster graphic bit-images, use the ePOS-Print XML generator tool or your own
application. Note the following when creating raster graphic images using your own application.
Two-tone image: Specify a multiple of 8 for the image width or fill the missing bits with zeros.
16-tone image: Specify a multiple of 2 for the image width or fill the missing bits with zeros.
Attribute
width : (Required attribute, data type xs:unsignedShort)
Specifies the image width in dots.
height : (Required attribute, data type xs:unsignedShort)
Specifies the image height in dots.
color : (Optional attribute, data type tns:color)
Specifies the character color.
74
Chapter 4 XML Reference
The align attribute set in this element also applies to the align attribute in each of the text,
logo, barcode, and symbol elements.
Example
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<image width="8" height="8">//////////8=</image>
</epos-print>
75
<logo>
Prints a logo registered in the NV memory of the printer.
• Using model-dedicated utility or logo registration utility (TMFLogo), register a logo in the printer
in advance.
• Multiple tone printing is not supported in Page Mode. Multiple tone graphic printing is supported
in Standard Mode only.
• In page mode, a logo is laid out in the current print position with the reference point being its
bottom left dot.
Attribute
key1 : (Required attribute, data type xs:unsignedByte)
Specifies the value of the key code 1 set at the time of NV logo registration.
key2 : (Required attribute, data type xs:unsignedByte)
Specifies the value of the key code 2 set at the time of NV logo registration. Be sure to
specify this value.
align : (data type tns:align)
Specifies the print position.
The align attribute set in this element also applies to the align attribute in each of the text,
image, barcode, and symbol elements.
Example
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<logo key1="48" key2="48" />
</epos-print>
76
Chapter 4 XML Reference
<barcode>
Prints a barcode.
Specifies the barcode data using a character string. (Data type xs:string)
• A barcode will not be printed if settings not compliant with the barcode standard are made, or if
the barcode becomes larger than the printer's print area. And an error response will not be
returned, either.
• 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).
Barcode Type
The following barcodes can be specified:
77
Barcode type Barcode data specification procedure
Specify a start character (CODE A, CODE B, CODE C).
A stop character is automatically added.
A check digit is automatically calculated and added.
To encode each of the following characters, specify two characters
starting with the character "{":
FNC1: {1
FNC2: {2
CODE128
FNC3: {3
FNC4: {4
CODE A: {A
CODE B: {B
CODE C: {C
SHIFT: {S
{: {{
A start character, FNC1, a check digit, and a stop character are
automatically added.
To automatically calculate and add a check digit for an application
identifier (AI) and the subsequent data, specify the character "*" in the
position of the check digit.
You can enclose an application identifier (AI) in parentheses. The
parentheses are used as HRI print characters and are not encoded as
data.
You can insert spaces between an application identifier (AI) and
GS1-128 data. The spaces are used as HRI print characters and are not
encoded as data.
To encode each of the following characters, specify two characters
starting with the character "{":
FNC1: {1
FNC3: {3
(: {(
): {)
*: {*
{: {{
GS1 DataBar
Omnidirectional Specify a 13-digit global trade item number (GTIN) not including an
GS1 DataBar Truncated application identifier (AI) or a check digit.
GS1 DataBar Limited
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 characters
GS1 DataBar Expanded
starting with the character "{":
FNC1: {1
(: {(
): {)
78
Chapter 4 XML Reference
To specify binary data that cannot be represented by character strings, use the following escape
sequences.
String Description
\xnn Control code
\\ Back slash
Attribute
type : (Required attribute, data typetns:barcode-type)
Specifies the barcode type.
79
width : (data type xs:unsignedByte Default "3")
Specifies the width of each module in dots. Specifies an integer from 2 to 6.
height : (data type xs:unsignedByte Default "162")
Specifies the barcode height in dots.
align : (data type tns:align)
Specifies the print position.
The align attribute set in this element also applies to the align attribute in each of the text,
image, logo, and symbol elements.
• For the standard mode, specify the rotate attribute "when at the start of a line".
• In page mode, even if rotate is specified, it is disabled.
• In the page mode, set the printing direction to "right_to_left" with "direction" and conduct
180 rotation printing.
• The rotate attribute set in this element also applies to the rotate attribute in each of the
text and symbol elements.
Example
To print barcodes:
epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<barcode type="upc_a" width="2" height="64" hri="below">01234567890</
barcode>
<barcode type="upc_e">01234500005</barcode>
<barcode type="ean13">201234567890</barcode>
<barcode type="jan13">201234567890</barcode>
<barcode type="ean8">2012345</barcode>
<barcode type="jan8">2012345</barcode>
<barcode type="code39">ABCDE</barcode>
<barcode type="itf">012345</barcode>
<barcode type="codabar">A012345A</barcode>
<barcode type="code93">ABCDE</barcode>
<barcode type="code128">{Babcde</barcode>
<barcode type="gs1_128">(01)201234567890*</barcode>
<barcode type="gs1_databar_omnidirectional">0201234567890</barcode>
<barcode type="gs1_databar_truncated">0201234567890</barcode>
<barcode type="gs1_databar_limited">0201234567890</barcode>
<barcode type="gs1_databar_expanded">(01)2012345678903</barcode>
</epos-print>
80
Chapter 4 XML Reference
<symbol>
Prints a 2D-code.
Specifies the 2D-code using a character string. (Data type xs:string)
• A 2D-code will not be printed if settings not compliant with the 2D-code standard are made, or if
the 2D-code becomes larger than the printer's print area. And an error response will not be
returned, either.
• In standard mode, a more than 831 dot high 2D-code cannot be printed.
• In page mode, a 2D-code is laid out in the current print position with the reference point being
its top left dot.
2D-code Type
The following 2D-codes can be specified:
Type Description
PDF417 Convert the character string to the string in UTF-8, apply the escape
sequence, and then encode the string.
The data area can contain up to 928 code words in a maximum of 90
rows, each of which can contain up to 30 code words.
QR Code Convert the character string to the string in Shift-JIS, apply the escape
Micro QR Code sequence, and then encode the string based on the data type as
shown below.
Number: 0 to 9
Alphanumeric character:
0 to 9, A to Z, space, $, %, *, +, -, ., /, :
Kanji character: Shift-JIS value
8-bit, byte data:
4
0x00 to 0xff
MaxiCode Convert the character string to the string in UTF-8, apply the escape
sequence, and then encode the string.
In Modes 2 and 3, when the first piece of data is [)>\ x1e01\x1dyy
(where yy is a two-digit number), this is processed as the message
header, and the subsequent data is processed as the primary mes-
sage. In other cases, from the first piece of data, data is processed as
the primary message.
In Mode 2, specify the primary message in the following format:
Postal code (1- to 9-digit number) GS:(\x1d) ISO country code (1- to 3-
digit number) GS:(\x1d) Service class code (1- to 3-digit number)
In Mode 3, specify the primary message in the following format:
Postal code (1 to 6 pieces of data convertible by Code Set A)
GS:(\x1d) ISO country code (1- to 3-digit number) GS:(\x1d) Service
class code (1- to 3-digit number)
GS1 DataBar Stacked Convert the character string to the string in UTF-8, apply the escape
GS1 DataBar Stacked sequence, and then encode the string.
Omnidirectional Specify a 13-digit global trade item number (GTIN) not including an
application identifier (AI) or a check digit.
81
Type Description
GS1 DataBar Expanded Convert the character string to the string in UTF-8, apply the escape
Stacked sequence, and then encode the string.
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 characters
starting with the character "{":
FNC1: {1
(: {(
): {)
Aztec Code After converting the character string to UTF-8, conduct the escape
sequence and encode.
DataMatrix After converting the character string to UTF-8, conduct the escape
sequence and encode.
To specify binary data that cannot be represented by character strings, use the following escape
sequences.
String Description
\xnn Control code
\\ Back slash
Attribute
type : (Required attribute, data type tns:symbol-type)
Specifies the 2D-code type.
82
Chapter 4 XML Reference
83
height : (data type xs:unsignedByte)
Specifies the height of each module.
The align attribute set in this element also applies to the align attribute in each of the text,
image, logo, and barcode elements.
• For the standard mode, specify the rotate attribute "when at the start of a line".
• In page mode, even if rotate is specified, it is disabled.
• In the page mode, set the printing direction to "right_to_left" with "direction" and conduct
180 rotation printing.
• The rotate attribute set in this element also applies to the rotate attribute in each of the
text and barcode elements.
84
Chapter 4 XML Reference
Example
To print 2D-codes:
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<symbol type="pdf417_standard">ABCDE</symbol>
<symbol type="qrcode_model_2" level="level_q">ABCDE</symbol>
<symbol type="maxicode_mode_2">908063840\x1d850\x1d001\x1d\x04</symbol>
<symbol type="gs1_databar_stacked">0201234567890</symbol>
<symbol type="gs1_databar_stacked_omnidirectional">0201234567890</symbol>
<symbol type="gs1_databar_expanded_stacked">(01)02012345678903</symbol>
<symbol type="azteccode_fullrange" level="23">ABCDE</symbol>
<symbol type="datamatrix_square">ABCDE</symbol>
</epos-print>
85
<hline>
Draws horizontal lines.
Attribute
x1 : (Required attribute, data type xs:unsignedShort)
Specifies the draw start position of the horizontal line (in dots).
x2 : (Required attribute, data type xs:unsignedShort)
Specifies the draw end position of the horizontal line (in dots).
style : (Optional attribute, data type tns:line-style)
Specifies the line type.
Example
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<hline x1="100" x2="200" style="thin_double" />
<hline x1="400" x2="500" style="thin_double" />
</epos-print>
86
Chapter 4 XML Reference
<vline-begin>
Starts to draw vertical lines.
• A vertical line is drawn up to the end position specified by the vline-end element (p. 88).
Use this element together with the vline-end element.
• Cannot be written in the <page> tag.
Attribute
x: (Required attribute, data type xs:unsignedShort)
Specifies the start position of the horizontal line (in dots).
style : (Optional attribute, data type tns:line-style)
Specifies the line type.
Example
To draw a thin line from 100th to 200th dot from the left end.
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<vline-begin x="100" />
4
<vline-begin x="200" />
<feed unit="100" />
<vline-end x="100" />
<vline-end x="200" />
</epos-print>
87
<vline-end>
Ends to draw vertical lines.
• Use this element together with the vline-begin element (p. 87).
• Cannot be written in the <page> tag.
Attribute
x: (Required attribute, data type xs:unsignedShort)
Specifies the end position of the horizontal line (in dots).
style : (Optional attribute, data type tns:line-style)
Specifies the line type.
Example
To draw a thin line from 100th to 200th dot from the left end.
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<vline-begin x="100" />
<vline-begin x="200" />
<feed unit="100" />
<vline-end x="100" />
<vline-end x="200" />
</epos-print>
88
Chapter 4 XML Reference
<page>
Changes the mode from standard mode to page mode.
Element Description
<text> Prints text
<feed> Paper feed
<image> Prints a raster image
<logo> Prints a NV logo
<barcode> Prints a barcode
<symbol> Prints a 2D-code
<area> Sets a print area
<direction> Sets a print direction
<position> Sets a print position
<line> Draws a line
<rectangle> Draws a rectangle
<command> Inserts a command
Example
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<page>
<text>ABCDE</text>
4
</page>
</epos-print>
89
<area>
Specifies the page mode print area.
Specifies the origin point, width, and height based on the absolute origin point to set the print area. The
absolute origin point is a dot diagonally above the top left corner of the printable area.
Absolute origin point
Origin point(x, y)
Width
Height
Print area
Paper
Attribute
x: (Required attribute, data type xs:unsignedShort Default "0")
Specifies the origin of the horizontal axis (in dots).
y: (Required attribute, data type xs:unsignedShort Default "0")
Specifies the origin of the vertical axis (in dots).
width : (Required attribute, data type xs:unsignedShort Default :Differ according to each
model)
Specifies the width of the print area (in dots).
height : (Required attribute data type xs:unsignedShort Default :Differ according to each
model)
Specifies the height of the print area (in dots).
Determine the width and height of the print area according to the print direction setting. Otherwise,
the print data might not be printed completely.
Example
To print the characters "ABCDE" by specifying the print area as origin (100, 50),
width: 200 dots, and height: 30 dots:
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<page>
<area x="100" y="50" width="200" height="30" />
<text>ABCDE</text>
</page>
</epos-print>
90
Chapter 4 XML Reference
<direction>
Specifies the page mode print direction.
Specifies the print direction and rotates the print area. Following the rotation of the print area, the start point
of the print area moves.
Attribute
dir : (Required attribute, data type tns:page-dir)
Specifies the rotation direction.
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<page>
<direction dir="top_to_bottom" />
<text>ABCDE</text>
</page>
</epos-print>
91
<position>
Specifies the page mode print position.
Specifies the print position based on the start point of the print area. The start point of the print area moves
by following the rotation of the print area.
Attribute
x: (Required attribute, data type xs:unsignedShort Default "0")
Specifies the origin of the horizontal axis (in dots).
y: (Required attribute, data type xs:unsignedShort Default "21")
Specifies the origin of the vertical axis (in dots).
Specify the print start position (coordinates) according to the content to be printed. Refer to the
following.
To print a character string:
Specify the left end of the baseline for the first character. This can be omitted for left-aligned
printing of standard-sized characters. To print double-sized height characters, specify a value
equal to or greater than 42 for y.
To print a barcode:
Specify the bottom left of the symbol. And specify the barcode height for y.
To print a graphic/logo:
Specify the bottom left of the graphic data. And specify the graphic data height for y.
To print a 2D-code:
Specify the top left of the symbol. This can be omitted when printing from the top left.
Example
To specify (50,30) for the print start position in the area specified by the addPageArea method and
print the characters "ABCDE":
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<page>
<area x="100" y="50" width="200" height="100" />
<position x="50" y="30" />
<text>ABCDE</text>
</page>
</epos-print>
92
Chapter 4 XML Reference
<line>
Draws a line in page mode.
Attribute
x1: (Required attribute, data type xs:unsignedShort)
Specifies the drawing start position of the horizontal line (in dots).
y1 : (Required attribute, data type xs:unsignedShort)
Specifies the drawing start position of the vertical line (in dots).
x2 : (Required attribute, data type xs:unsignedShort)
Specifies the drawing end position of the horizontal line (in dots).
y2 : (Required attribute, data type xs:unsignedShort)
Specifies the drawing end position of the vertical line (in dots).
style : (data type tns:line-style)
Specifies the line type.
To draw a thin solid line between the start position (100, 0) and the end position (500, 0):
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<page>
<line x1="100" y1="0" x2="500" y2="0" style="thin" />
</page>
</epos-print>
93
<rectangle>
Draws a rectangle in page mode.
Attribute
x1: (Required attribute, data type xs:unsignedShort)
Specifies the drawing start position of the horizontal line (in dots).
y1 : (Required attribute, data type xs:unsignedShort)
Specifies the drawing start position of the vertical line (in dots).
x2 : (Required attribute, data type xs:unsignedShort)
Specifies the drawing end position of the horizontal line (in dots).
y2 : (Required attribute, data type xs:unsignedShort)
Specifies the drawing end position of the vertical line (in dots).
style : (data type tns:line-style)
Specifies the line type.
Example
To draw a rectangle with a thin double line, with the start position (100, 0) and the end position
(500, 200) as its vertexes:
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<page>
<rectangle x1="100" y1="0" x2="500" y2="200" style="thin-double" />
</page>
</epos-print>
94
Chapter 4 XML Reference
<cut>
Sets paper cut.
Attribute
type : (data type tns:cut-type)
Specifies the paper cut type.
Example
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<cut type="feed" />
</epos-print>
4
95
<pulse>
Outputs signals to the drawer kick connector.
Depending on the model, a buzzer can be sounded.
Attribute
drawer : (data type tns:pulse-drawer)
Specifies the drawer kick connector.
Example
To send a 100msec pulse signal to the pin 2 of the drawer kick connector:
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<pulse drawer="drawer_1" time="pulse_100" />
</epos-print>
96
Chapter 4 XML Reference
<sound>
Sounds a buzzer.
Attribute
pattern : (data type tns:sound-pattern)
Specifies the buzzer pattern.
97
Example
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<sound pattern="pattern_a" repeat="3" />
</epos-print>
98
Chapter 4 XML Reference
<command>
Insert the ESC / POS command.
ESC / POS command is specified in hexadecimal encoding. (data type xs:hexBinary)
Example
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<command>41424344450a</command>
</epos-print>
99
<layout>
To use sheets with black mark or die-cut labels, set the paper layout in advance.
(in ePOS-Print Service Ver.2.2 and later)
Attribute
type : (data type tns:layout-type)
Specifies the paper type.
100
Chapter 4 XML Reference
*: Valid value of range is depending on the printer model. For detail, refer to Support Information by Printer
(p.106).
101
Detailed description
See below for the parameters that can be specified for each type of paper, and the positions for those
parameters.
Mark Parameter
sf width
sa height
sb margin_top
se margin_bottom
sc offset_cut
sd offset_label
Cut
Receipt sa
sc
sf sf
sb Cut sb
sc Bottom edge sc
of label
102
Chapter 4 XML Reference
Example
Paper change
To change paper, it is necessary to change the paper type before printing.
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<layout type="receipt" width="580" />
</epos-print>
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<layout type="receipt_bm" width="580" height="0" margin-top="15" offset-
cut="0" />
</epos-print>
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<layout type="label" width="580" height="0" margin-top="15" margin-
bottom="-15" offset-cut="25" />
</epos-print>
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<layout type="label_bm" width="580" height="0" margin-top="15"
margin-bottom="-15" offset-cut="25" offset-label = "15" />
</epos-print>
<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
</epos-print>
103
<recovery>
Recovers from an error. (in ePOS-Print Service Ver.3.0 and later)
Example
Recovers from errors that can be recovered from and clears the buffer.
104
Chapter 4 XML Reference
<reset>
Resets the printer. (in ePOS-Print Service Ver.3.0 and later)
Example
105
Support Information by Printer
Model Page Model Page Model Page
TM-T70-i TM-T70
p. 121 p. 121 TM-T70II-DT p. 123
Multi-language model Multi-language model
TM-H6000IV-DT
Receipt
80 mm 58 mm
Character Baseline Font A At the 21st dot from the top of the character
Page Mode Default Area 512 dots x 831 dots (W x H) 360 dots x 831 dots (W x H)
Page Mode Maximum Area 512 dots x 1662 dots (W x H) 360 dots x 1662 dots (W x H)
106
Chapter 4 XML Reference
Receipt
80 mm 58 mm
Rectangle
<rectangle>
107
TM-L90-i/ TM-L90
Print Width 256 dots (38 mm) to 224 dots (38 mm) to
576 dots (80 mm) 560 dots (80 mm)
Character Baseline Font A At the 21st dot from the top of the character
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 576 dots x 1476 dots (W x H) 560 dots x 1476 dots (W x H)
when two- 576 dots x 738 dots (W x H) 560 dots x 738 dots (W x H)
color
printing is
set
Barcode <barcode> UPC-A, UPC-E, EAN13, JAN13, EAN8, JAN8, CODE39, ITF,
CODABAR, CODE93, CODE128
108
Chapter 4 XML Reference
Rectangle
<rectangle>
Paper Layout Settings <layout> Not supported (With automatic setup mode)
Item Value
109
TM-P20
58 mm
Character Baseline Font A At the 21st dot from the top of the character
Barcode <barcode> UPC-A, UPC-E, EAN13, JAN13, EAN8, JAN8, CODE39, ITF,CODABAR,
CODE93, CODE128, GS1-128,
GS1 DataBar Omnidirectional, GS1 DataBar Truncated,
GS1 DataBar Limited, GS1 DataBar Expanded
110
Chapter 4 XML Reference
58 mm
Rectangle
<rectangle>
111
TM-P60II/ TM-P60II with Peeler
Character Baseline Font A At the 21st dot from the top of the character
Page Mode Default Area 432 dots x 1624 dots (W x H) 400 dots x 1624 dots (W x H)
Page Mode Maximum Area 432 dots x 1624 dots (W x H) 400 dots x 1624 dots (W x H)
Barcode <barcode> UPC-A, UPC-E, EAN13, JAN13, EAN8, JAN8, CODE39, ITF,
CODABAR, CODE93, CODE128, GS1-128, GS1 DataBar
Omnidirectional, GS1 DataBar Truncated, GS1 DataBar Limited,
GS1 DataBar Expanded
2D-Code <symbol> PDF417, QR Code, MaxiCode, GS1 DataBar Stacked, GS1 DataBar
Stacked Omnidirectional, GS1 DataBar Expanded Stacked, Aztec
Code, DataMatrix (Composit Symbology : Not supported)
Rectangle
<rectangle>
112
Chapter 4 XML Reference
Paper Layout
Die-cut label Die-cut label
Receipt paper Receipt paper
paper paper
Paper type (without black (with black
(without black (with black
mark) mark)
mark) mark)
width (sf) 290 to 600 290 to 600 290 to 600 290 to 600
offset_label (sd) 0 0 0 0 to 15
113
TM-P80
80 mm
Character Baseline Font A At the 21st dot from the top of the character
Barcode <barcode> UPC-A, UPC-E, EAN13, JAN13, EAN8, JAN8, CODE39, ITF,CODABAR,
CODE93, CODE128, GS1-128,
GS1 DataBar Omnidirectional, GS1 DataBar Truncated,
GS1 DataBar Limited, GS1 Databar Expanded
Rectangle
<rectangle>
114
Chapter 4 XML Reference
Paper Layout
Receipt paper Receipt paper
Paper type
(without black mark) (with black mark)
margin_bottom (se) 0 0
offset_label (sd) 0 0
115
TM-T20
58 mm 80 mm
Character Baseline Font A At the 21st dot from the top of the character
Page Mode Default Area 420 dots x 831 dots (W x H) 576 dots x 831 dots (W x H)
Page Mode Maximum Area 420 dots x 1662 dots (W x H) 576 dots x 1662 dots (W x H)
Barcode <barcode> UPC-A, UPC-E, EAN13, JAN13, EAN8, JAN8, CODE39, ITF,
CODABAR, CODE93, CODE128, GS1-128, GS1 DataBar
Omnidirectional, GS1 DataBar Truncated, GS1 DataBar Limited,
GS1 DataBar Expanded
2D-Code <symbol> PDF417, QR Code, MaxiCode, GS1 DataBar Stacked, GS1 DataBar
Stacked Omnidirectional, GS1 DataBar Expanded Stacked
(Composit Symbology : Not supported)
Rectangle
<rectangle>
116
Chapter 4 XML Reference
TM-T20II-i/ TM-T20II
58 mm 80 mm
Character Baseline Font A At the 21st dot from the top of the character
Color Specification
Rectangle
<rectangle>
117
58 mm 80 mm
Item Value
Character Code Tables Page 0-5, 16-19, 20-21, 26,30-31, 11-15, 32-53
118
Chapter 4 XML Reference
TM-T70-i/ TM-T70
58 mm 80 mm
Character Baseline Font A At the 21st dot from the top of the character
Barcode <barcode> UPC-A, UPC-E, EAN13, JAN13, EAN8, JAN8, CODE39, ITF,
CODABAR, CODE93, CODE128
4
2D-Code <symbol> PDF417, QR Code
Rectangle
<rectangle>
119
ePOS-Print Setting (TM-T70)
Item Value
120
Chapter 4 XML Reference
80 mm
Character Baseline Font A At the 21st dot from the top of the character
Barcode <barcode> UPC-A, UPC-E, EAN13, JAN13, EAN8, JAN8, CODE39, ITF,
CODABAR, CODE93, CODE128
4
2D-Code <symbol> PDF417, QR Code
Rectangle
<rectangle>
121
ePOS-Print Setting (TM-T70)
Item Value
122
Chapter 4 XML Reference
TM-T70II-DT/ TM-T70II
80 mm
Character Baseline Font A At the 21st dot from the top of the character
Barcode <barcode> UPC-A, UPC-E, EAN13, JAN13, EAN8, JAN8, CODE39, ITF,
CODABAR, CODE93, CODE128, GS1-128,GS1 DataBar
4
Omnidirectional, GS1 DataBar Truncated, GS1 DataBar Limited,
GS1 Databar Expanded
Rectangle
<rectangle>
123
ePOS-Print Setting
Item Value
Character Code Tables Page 0-5, 16-19, 20-21, 26,30-31, 11-15, 32-53
124
Chapter 4 XML Reference
TM-T82II-i/ TM-T82II
80 mm
Character Baseline Font A At the 21st dot from the top of the character
Color Specification
Rectangle
<rectangle>
125
80 mm
126
Chapter 4 XML Reference
TM-T83II-i/ TM-T83II
80 mm
Character Baseline Font A ANK: At the 21st dot from the top of the character
Kanji: At the 21st dot from the top of the character
Font B ANK: At the 16th dot from the top of the character
Kanji: At the 15th dot from the top of the character
Barcode <barcode> UPC-A, UPC-E, EAN13, JAN13, EAN8, JAN8, CODE39, ITF,
CODABAR, CODE93, CODE128, GS1-128, GS1 DataBar
Omnidirectional,
GS1 DataBar Truncated,GS1 DataBar Limited,
GS1 DataBar Expanded
Rectangle
<rectangle>
127
80 mm
128
Chapter 4 XML Reference
TM-T88IV
80 mm 58 mm
Resolution 180 dpi x 180 dpi (W x H)
Character Baseline Font A At the 21st dot from the top of the character
Page Mode Default Area 512 dots x 831 dots (W x H) 360 dots x 831 dots (W x H)
when two- 512 dots x 415 dots (W x H) 360 dots x 415 dots (W x H)
color
printing is
set
Page Mode Maximum Area 512 dots x 1662 dots (W x H) 360 dots x 1662 dots (W x H)
when two-
color
512 dots x 831 dots (W x H) 360 dots x 831 dots (W x H) 4
printing is
set
Bar Code UPC-A, UPC-E, EAN13, JAN13, EAN8, JAN8, CODE39, ITF,
CODABAR, CODE93, CODE128, GS1-128
Rectangle
<rectangle>
129
80 mm 58 mm
Command <command> Supported
ePOS-Print Setting
Item Value
130
Chapter 4 XML Reference
58 mm 80 mm
Special font
30 characters 42 characters
A*
Special font
40 characters 56 characters
B*
Special font
12 dots x 24 dots (W x H)
A*
Special font
9 dots x 24 dots (W x H)
B*
4
Character Baseline Font A At the 21st dot from the top of the character
Special font
At the 20th dot from the top of the character
A*
Special font
At the 20th dot from the top of the character
B*
Page Mode Default Area 360 dots x 831 dots (W x H) 512 dots x 831 dots (W x H)
Page Mode Maximum Area 360 dots x 1662 dots (W x H) 512 dots x 1662 dots (W x H)
Barcode <barcode> UPC-A, UPC-E, EAN13, JAN13, EAN8, JAN8, CODE39, ITF,
CODABAR, CODE93, CODE128, GS1-128,GS1 DataBar
Omnidirectional, GS1 DataBar Truncated, GS1 DataBar Limited,
GS1 Databar Expanded
131
* Only for South Asia model
58 mm 80 mm
Rectangle
<rectangle>
Item Value
Character Code Tables Page 0-5, 16-19, 20-21, 26,30-31, 11-15, 32-53
132
Chapter 4 XML Reference
TM-T90
58 mm 60 mm 80 mm
Character Baseline Font A At the 21st dot from the top of the character
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- 360 dots x 831 dots 384 dots x 831 dots 512 dots x 831 dots
color (W x H) (W x H) (W x H)
printing is
set
Barcode <barcode> UPC-A, UPC-E, EAN13, JAN13, EAN8, JAN8, CODE39, ITF,
CODABAR, CODE93, CODE128
133
58 mm 60 mm 80 mm
Rectangle
<rectangle>
ePOS-Print Setting
Item Value
134
Chapter 4 XML Reference
TM-U220-i/ TM-U220
76 mm 70 mm 58 mm
Logo <logo>
Barcode <barcode>
Not supported
Not supported
4
2D-Code <symbol> Not supported
Rectangle
<rectangle>
135
136
Appendix
Appendix
ePOS-Print Editor
This section describes how to use ePOS-Print Editor included in the contents in the package.
This tool is a support tool for generating XML data. This tool allows you to create an ePOS-Print XML (p. 61)
print document as you like. In addition, the generated XML data can be printed for testing. Use this tool for
your application development.
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.
1 Copy the editor folder contained in the sample program to the Web server.
137
3 ePOS-Print Editor appears.
138
Appendix
Setting
Perform the print setting and the preview setting. Select the [Setting] tab to display the Setting screen.
Item Description
Specify the model of the printer to be used for printing.
Model The Preview screen resizes according to the paper width
set to the model.
IP address of ePOS-Print supported TM Specify the IP address of the printer.
printer Be sure to specify this item.
Specify the device ID of the printer.
Device ID of the target printer
Be sure to specify this item.
Specify the print timeout time in milliseconds.
Print timeout (milliseconds)
The maximum value is 60000 (60 seconds).
When this checkbox is checked, the printer's status is
Monitor the status
monitored.
Use print job ID Check this for a print job ID to be assigned when printing.
139
Creating a Sample Code
Select the [Edit] tab to display the Edit screen. Create an ePOS-Print XML print document in the Edit screen.
Item Description
Displays the available functions.
Menu area 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.
Displays the functions selected in the menu area.
Edit area Drag an element to change its position. An element can be deleted using the x
button located on its right side.
ePOS-Print Editor can import an ePOS-Print XML print document.
Import
For details, refer to Import (p.144).
Clear Deletes the edited details.
Forced Transmission Sets forced transmission mode.
140
Appendix
1 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.
• Logo printing, barcode printing, 2D code printing, ESC command, buzzer sound, drawer kick,
and paper cut are displayed as icons.
• The layout may change depending on the preview settings.
(For details, refer to Setting (p.139)).
141
4 Select the [XML] tab. The ePOS-Print XML document is displayed. Use it by copying.
Save the ePOS-Print XML print document, and you can edit it by importing it again.
142
Appendix
Print
Using the printer, print the ePOS-Print XML print document according to the printer's settings to perform test
printing.
(For details on the printer settings, refer to Setting (p.139)).
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.
Information Displays the print status.
Clear Deletes the content in the [Information] box.
2 Check the content in the [Data to be sent (ePOS-Print XML)] box and press the
[Send] button.
The ePOS-Print XML print document created using the Edit tab page is displayed in "Data to be sent
(ePOS-Print XML)".
143
Import
ePOS-Print Editor can import an ePOS-Print XML print document.
This function is used to edit the already created ePOS-Print XML print document.
Item Description
Data to be import
Pastes the ePOS-Print XML print document.
(ePOS-Print XML)
Apply Imports the ePOS-Print XML print document.
Information Displays the import information.
Close Closes the Import screen.
2 The "Import" screen appears. Paste the ePOS-Print XML print document in the
[Data to be import (ePOS-Print XML)] box.
144
Appendix
1 Store the image file you want to print into the same level as the index of this tool.
3 Select the [Image] icon in the menu area and add it in the edit area.
4 Specify the name of the stored image file for "Image File (on the Server Side)" and
click the [Load] button.
5 Specify values as needed for "Scale to Fit Paper Width", "Mode", "Brightness",
"Color", and "Halftone".
145
6 Select the [XML] tab.
146