0% found this document useful (0 votes)
11 views146 pages

Epos-Print XML Um en Revk

Uploaded by

Yasir Shokry
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views146 pages

Epos-Print XML Um en Revk

Uploaded by

Yasir Shokry
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 146

ePOS-Print XML

User’s Manual

Overview
Describes the features and development environment.

Sample Program (XML Print Service)


Describes how to use the sample program and
how to build a system.

Programming Guide (XML Print Service)


Describes how to write programs in Web application
development.

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.

ESC/POS® Proprietary Command System


Epson took the initiative by introducing ESC/POS, a proprietary POS printer command system, which
includes patented or patent pending commands and enables versatile POS system construction with high
scalability.
Compatible with all types of Epson POS printers and displays, this proprietary control system also offers the
flexibility to easily make future upgrades. Its popularity is worldwide.
ESC/POS is designed to reduce the processing load on the host computer in POS environments. It comprises
a set of highly functional and efficient commands that enables the full realization of the potential of printers.

© Seiko Epson Corporation 2012-2015. All rights reserved.

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.

Provides information that must be observed to avoid damage to your equipment or a


malfunction.

Provides important information and useful tips.

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

Aim of the Manual


This manual is aimed to provide developers with information required for developing and designing
applications using ePOS-Print XML.

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

Sample Program (XML Print Service) .........................................19


■ Overview............................................................................................................................. 19
Sample Program Overview................................................................................................................. 19
■ Environment ........................................................................................................................ 20
■ Operating Environment ..................................................................................................... 21
■ Environment Settings.......................................................................................................... 22
ePOS-Print Settings ............................................................................................................................... 23
Editing the Sample Program............................................................................................................... 25
Registering the Sample Program ....................................................................................................... 25

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

Programming Guide (XML Print Service)................................... 39


■ How to Use XML Schemas ................................................................................................. 39
Visual Studio ..........................................................................................................................................39
Eclipse ....................................................................................................................................................42
■ ePOS-Print XML ................................................................................................................... 43
Print Mode .............................................................................................................................................43
Programming Flow................................................................................................................................43
Print Document Creation ....................................................................................................................44
Transmission of Print Document...........................................................................................................48
Reception of Print Result......................................................................................................................51
Checking the Printer Status .................................................................................................................53
■ Specifying the Print Job ID from the Application ............................................................ 54
■ Using the Spooler Function................................................................................................ 55
Programming Example ........................................................................................................................56
■ Printing in Other Environments .......................................................................................... 58
.NET Framework.....................................................................................................................................58
Java .......................................................................................................................................................60

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).

XML Print Service


ePOS-Print XML allows printing to ePOS-Print supported TM printer from applications in an environment or on
OS where HTTP communication is possible. ePOS-Print XML embedded into native applications on smart
phones and tablet terminals makes it possible to print from such devices.
When a print document is sent from a host to an ePOS-Print supported TM printer using SOAP/HTTP, the
ePOS-Print supported TM printer performs printing and returns a response document.

(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.

SOAP/HTTP Interface (WSDL supported)


When a print document is sent from an application to ePOS-Print Service using SOAP/HTTP, ePOS-Print
performs printing and returns a response document. Job ID can be specified.
(ePOS-Print Service Ver.4.1 or later versions supported.)

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

Interface for FileMaker


This interface uses the HTTP POST function of FileMaker for printing.
(ePOS-Print Service Ver.4.1 or later versions supported.)

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.

WSDL(Web Services Description Language)


WSDL defines the SOAP/HTTP interface in XML Print Service.
This allows you to generate client codes (proxy class) from WSDL by using the tool provided in the
development environment.
File name: epos-print-4.x.x.wsdl
epos-print-4.x.x.xsd
For details, refer to Printing in Other Environments (p.58).

Print Image

Print text

Print barcode: EAN13


Paper feed: 24 dots
Print raster image

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.)

ePOS-Print Supported Printer


For differences in functions according to printer type, refer to Support Information by Printer (p.106).

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-Fimodel)
❏ 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.

Printer Type Network printer control Spooler/Print forwarding HTTPS Communication


TM-DT Software TM-DT Software
TM-DT Series ●*
Ver.3.0 or later Ver.2.5 or later
TM-i Firmware TM-i Firmware
TM-i Series ●*
Ver.4.1 or later Ver.4.3 or later
TM Printer - - -

* 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.

EPSON TMNet WebConfig


ePOS-Print Service TM-DT Software TM-i Firmware
Wi-Fi Model UB-R04
1.2 - 1.2x - -
2.0 - 2.0x - -
2.1 - 2.1x - -
2.2 2.0x - 2.2 2.2
3.0 2.2x, 2.5x 3.0x, 3.1x, 4.0x 3.0 3.0
3.2 - - 3.2 -
4.1 3.0x 4.1x, 4.3x - -

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

File name Description


ePOS-Print_Sample_XML_Vx.x.xE.zip This is a sample program file.
ePOS-Print_XML_um_en_revx.pdf This Document.

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)

Sample Program (XML Print Service)


This chapter describes the environment settings for using ePOS-Print and how to use the sample program for
printing print data that is created with XML Reference from a printer by using 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

Sample Program Overview


The following screen appears when the sample program starts. Click the [Print] button to execute.

Sample program execution result

Print text

Print barcode: EAN13


Paper feed: 24 dots
Application Environment
Paper cut

A response message from ePOS-Print supported TM printer

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:

Environment File Name


HTML5-supported Web browser HtmlApplication1.zip
Java JavaProject1.zip
Windows (Visual Basic .NET) WindowsApplication1.zip
Silverlight SilverlightApplication1.zip, crossdomain.zip
Flash FlexProject1.zip, crossdomain.zip
Android AndroidProject1.zip
iOS iOSDeviceProject1.zip
Windows CE SmartDeviceProject1.zip
Windows Store Apps App1.zip

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

Wireless LAN Router


Terminal [192.168.192.1]
[192.168.192.XXX] *
ePOS-Print supported TM printer
* [192.168.192.20]
: When DHCP is used for the terminal

❏ 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.

2. Network Setting of ePOS-Print Supported printer


Configuration is done from a Web browser. For details, refer to the Technical Reference Guide for
the printer.

3. Network settings for the printer to be controlled


Configure these settings by using the network setting utility. For details, refer to the detailed
instruction manual for the printer (these settings are not required in this sample program).

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.

5. ePOS-Print Settings (p.23)


Configuration is done from a Web browser.

6. Editing the Sample Program (p.25)


Write the IP address of ePOS-Print supported TM printer in the source code of the sample program
using an editor program.

7. Registering the Sample Program (p.25)


Make registration using a Web browser.
(Required for HTML5, Silverlight, and Flash sample programs.)

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)

TM Printer (Wireless LAN Model)


For a TM printer, enable ePOS-Print and set the device ID.

Configure the settings via the network. USB connection cannot be used for setting.

Configure the settings as follows:

1 Connect the TM printer to the network. 2


2 Start the web browser of the setting computer and input the TM printer IP address
into the address bar.
EpsonNet Config (web version) is displayed.

3 Click [ePOS-Print]. The "ePOS-Print" screen is displayed.


Configure the following settings.
 For wireless LAN interface (UB-R04)

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].

5 Turn the TM printer's power off and on again.

24
Chapter 2 Sample Program (XML Print Service)

Editing the Sample Program


Write the IP address of ePOS-Print supported TM printer in the sample program. Edit the program as follows:

1 Expand HtmlApplication1.zip.

2 Open index.html using an editor program.

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.

// URL of ePOS-Print supported TM printer


var address = 'http://192.168.192.168/cgi-bin/epos/
service.cgi?devid=local_printer&timeout=10000

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:

1 Start the Web server.

2 Copy the sample program into the following folder:


Example: Web server configured by using IIS
System drive:\ Inetpub\wwwroot

Copy the sample program as a user with administrator authority.

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)

HTML5 (To Build a Web Server on Windows/Linux)

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

Environment Setting Procedure

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

4 Open the sample program html file using Visual Studio.

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

1 Obtain Java SE 6 and install that program.

2 Configure your computer and ePOS-Print supported TM printer so that they can
connect to the network.

3 Uncompress the sample program into any folder.

4 Import the sample program using Eclipse.

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

Environment Setting Procedure

1 Configure your computer and ePOS-Print supported TM printer so that they can
connect to the network.

2 Uncompress the sample program into any folder.

3 Open the sample program solution file using Visual Studio.

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.

1 Download Microsoft Silverlight 4 Tools for Visual Studio 2010(Silverlight4_Tools.exe)


and install that program.

2 Configure your computer and ePOS-Print supported TM printer so that they can
connect to the network.

3 Uncompress the sample program into any folder.

4 Open the sample program solution file using Visual Studio.

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

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.

1 Download Adobe Flash Builder from Flash Platform.

2 Configure your computer and ePOS-Print supported TM printer so that they can
connect to the network.

3 Uncompress the sample program into any folder.

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

Environment Setting Procedure

1 Obtain Android SDK and expand it into any folder.

2 Download Java SE Development Kit 6 and install that program.

3 Start Android SDK Manager and install the Android 1.5(API3) package.

4 Start Android AVD Manager and create [Android Virtual Device].


See "Creating Android Virtual Device" on page 32.

5 Install ADT Plug-in in Eclipse.


See "Installing ADT Plug-in" on page 32

6 Change the settings of Eclipse.


See "Changing the settings of Eclipse" on page 32

7 Configure your computer and ePOS-Print supported TM printer so that they can
connect to the network.

8 Uncompress the sample program into any folder.

9 Import the sample program using Eclipse.

31
Creating Android Virtual Device

1 Start Eclipse.

2 Select as [Windows]-[Android SDK and AVD Manager].

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.

Installing ADT Plug-in

1 Start Eclipse.

2 From the menu items, select as [Help]-[Install New Software].

3 The "Install" screen appears. Click the [Add] button.

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.

6 When the installation process finishes, restart Eclipse.

Changing the settings of Eclipse

1 Start Eclipse.

2 Select as [Windows]-[Configuration].

3 The "Setting" screen appears. Select [Android].


Although a warning dialog box appears, telling you that a path to Android SDK has not been set,
there is no problem.

4 Click the [Browse] button.

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

1 Install Visual Studio 2008 SP1.

2 Download Windows Embedded Compact 7 and install that program.

3 Install Virtual PC 2007.

4 Configure your computer and ePOS-Print supported TM printer so that they can
connect to the network.

5 Uncompress the sample program into any folder.

6 Open the sample program solution file using Visual Studio.

7 Execute the sample program using Visual Studio.

33
8 The Device Emulator starts. In the Device Emulator, select as [File]-[Configure...]-
[Network].

9 The "Emulator Properties" dialog box appears. Select [Network].


Tick "Enable NE2000 PCMCIA network adapter and bind to:" and select the
computer's network card. Click the [OK] button.

34
Chapter 2 Sample Program (XML Print Service)

10 In the Device Emulator, select as [Start]-[Settings].

11 In the Device Emulator, select as [Settings]-[Connections]-[Network Cards].


2

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.

14 A confirmation dialog box appears. Click [Yes].

15 Restart the Device Emulator.

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.

Environment Setting Procedure

1 Expand iOSDeviceProject1.zip.

2 Start XCode and open the [iOSDeviceProject1.xcodeproj] project file.

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

Environment Setting Procedure

1 Configure your computer and ePOS-Print supported TM printer so that they can
connect to the network.

2 Uncompress the sample program into any folder.

3 Open the sample program solution file using Visual Studio.

38
Chapter 3 Programming Guide (XML Print Service)

Programming Guide (XML Print Service)


This chapter describes how to write programs in the application development using ePOS-Print.

How to Use XML Schemas


The XML document editing support function in the integrated development environment helps efficiently
create XML documents and validate XML documents.

This section describes specific procedures using Visual Studio (p. 39) and Eclipse (p. 42) as
examples.

Visual Studio

Setting Procedure

1 Create a new project.


[File ]-[New]-[Project...]
3

2 Add an XML file to the created project. 


[Project]-[Add New Item...]

39
3 Set the XML schema "epos-print-4.x.x.xsd" to the XML file.
[XML]-[Schemas...]-[Add...]

Editing Example

For details on elements, refer to XML Reference (p.61).

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:

<?xml version="1.0" encoding="UTF-8"?>


<epos-print xmlns:xsi=”http://www.w3.org/2001/XMLschema-instance” 
xsi:schemaLocation="http://www.epson-pos.com/schemas/2011/03/epos-print
epos-print-4.x.x.xsd" 
xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">

<text lang='en'>Hello&#10;</text>

</epos-print>

For details on elements, refer to XML Reference (p.61).

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:

1. Print Document Creation (p 44)


❏ To create a text print document: (p.45)
❏ To create a graphic print document: (p.46)
❏ To create a page mode print document: (p.47)

2. Transmission of Print Document (p 48)

3. Reception of Print Result (p 51)

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!&#10;</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)

To create a text print document:


Create a text print document using the text element in the epos-print root element. Configure the settings
for the text to print using the attributes of the text element.
Refer to the following program for print document creation.

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!&#10;</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.

To create a print document with a checkered flag raster image:

<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)

To create a page mode 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.

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.

To Call SOAP/HTTP Interface


Refer to the following program.

<!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!&#10;</text>';
request += '<cut type="feed"/>';
request += '</epos-print>';

//Create a SOAP envelop


var soap = '<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">' + 
'<s:Body>' + request + '</s:Body></s:Envelope>';

//Create an XMLHttpRequest object


var xhr = new XMLHttpRequest();
//Set the end point address
var url = 'http://192.168.192.168/cgi-bin/epos/
service.cgi?devid=local_printer&timeout=10000';
//Open an XMLHttpRequest object
xhr.open('POST', url, true);
//<Header settings>
xhr.setRequestHeader('Content-Type', 'text/xml; charset=utf-8');
xhr.setRequestHeader('If-Modified-Since', 'Thu, 01 Jan 1970 00:00:00 GMT');
xhr.setRequestHeader('SOAPAction', '""');

// Send print document


xhr.send(soap);
}
</script> Send print document
</head>
<body>
</body>
</html>

48
Chapter 3 Programming Guide (XML Print Service)

To Call SOAP/HTTP Interface (WSDL supported)


Refer to the following program.

<!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!&#10;</text>';
request += '<cut type="feed"/>';
request += '</epos-print>';

//Create a print parameter


var param = '<parameter xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">';
param += '<devid>local_printer</devid>';
param += '<timeout>10000</timeout>';
param += '<printjobid>ABC123</printjobid>'
param += '</parameter>';

//Create a SOAP envelop


var soap = '<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">' + 
'<s:Header>' + param + '</s:Header><s:Body>' + request + 
'</s:Body></s:Envelope>';

//Create an XMLHttpRequest object


var xhr = new XMLHttpRequest();
//Set the end point address
var url = 'http://192.168.192.168/cgi-bin/epos/service.cgi';
//Open an XMLHttpRequest object
xhr.open('POST', url, true);
3
//<Header settings>
xhr.setRequestHeader('Content-Type', 'text/xml; charset=utf-8');
xhr.setRequestHeader('If-Modified-Since', 'Thu, 01 Jan 1970 00:00:00 GMT');
xhr.setRequestHeader('SOAPAction', '""');

// Send print document


xhr.send(soap);
}
</script> Send print document
</head>
<body>
</body>
</html>

49
Printer End Point Address
Specify the printer end point address in the following format:

To Call SOAP/HTTP Interface (p.10)


http://[IP address]/cgi-bin/epos/service.cgi?devid=[device ID]&timeout=[timeout time]

To Call SOAP/HTTP Interface (WSDL supported) (p.10)


http://[IP address]/cgi-bin/epos/service.cgi

Items to specify Description


IP address Specify either the IP address or the domain name of ePOS-Print supported TM
printer.
Device ID Specifies the printer to be used for printing. The maximum value is 60 seconds
(60000).
Specify the Device ID registered using the EPSON TMNet WebConfig(EpsonNet
Config) of ePOS-Print supported TM printer
Timeout period Specifies the time to abort the process in milliseconds. The maximum value is 300
seconds (300000).
The timeout parameter is optional; when it is omitted, 60 seconds (60000) is set.
When the timeout period elapses, the print job is canceled; the data already
interpreted by the printer before the start of the print abort process is printed.

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)

Reception of Print Result


Set a callback function using the response root element (p. 63) to receive print results.
The following information is obtained:
❏ Print result
❏ Error code
❏ Printer status
❏ Printer's battery status

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!&#10;</text>';
3
request += '<cut type="feed"/>';
request += '</epos-print>';

//Create a SOAP envelop


var soap = '<?xml version="1.0" encoding="utf-8"?>' + 
'<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>' + request + '</s:Body></s:Envelope>';

//Create an XMLHttpRequest object


var xhr = new XMLHttpRequest();
//Set the end point address
var url = 'http://192.168.192.168/cgi-bin/epos/
service.cgi?devid=local_printer&timeout=10000';
//Open an XMLHttpRequest object
xhr.open('POST', url, true);
//<Header settings>
xhr.setRequestHeader('Content-Type', 'text/xml; charset=utf-8');
xhr.setRequestHeader('If-Modified-Since', 'Thu, 01 Jan 1970 00:00:00 GMT');
xhr.setRequestHeader('SOAPAction', '""');

//Set a callback function


xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status == 200) {
//Obtain the response root element
var res = xhr.responseXML;
var success = res.getElementsByTagName('response')[0].getAttribute('success');
//When the printing is not successful, display a message
if (!/^(1|true)$/.test(success)) {
alert('A print error occurred');
}
}
}

// Send print document Callback function for print


xhr.send(soap); result reception
}
</script>
</head>
<body>
</body>
</html>

51
Error handling
Refer to the following program for the error handling method by a callback function.

// Set a response receipt callback function


xhr.onreadystatechange = function () {
.
.
.
// Obtain the print result and error code
var res = xhr.responseXML;
var msg = 'Print' + (res[0].getAttribute('success') ? 'Success' : 'Failure') + 
'\nCode:' + res[0].getAttribute('code') + 
'\nStatus:\n';
// Obtain the printer status
var asb = res[0].getAttribute('status');
if (asb & 0x00000001) {
msg += ' No printer response\n';
}
if (asb & 0x00000002) {
msg += ' Print complete\n';
}
if (asb & 0x00000004) {
msg += ' Status of the drawer kick number 3 connector pin = "H"\n';
}
if (asb & 0x00000008) {
msg += ' Offline status\n';
}
if (asb & 0x00000020) {
msg += ' Cover is open\n';
}
if (asb & 0x00000040) {
msg += ' Paper feed switch is feeding paper\n';
}
if (asb & 0x00000100) {
msg += ' Waiting for online recovery\n';
}
if (asb & 0x00000200) {
msg += ' Panel switch is ON\n';
}
if (asb & 0x00000400) {
msg += ' Mechanical error generated\n';
}
if (asb & 0x00000800) {
msg += ' Auto cutter error generated\n';
}
if (asb & 0x00002000) {
msg += ' Unrecoverable error generated\n';
}
if (asb & 0x00004000) {
msg += ' Auto recovery error generated\n';
}
if (asb & 0x00020000) {
msg += ' No paper in the roll paper near end detector\n';
}
if (asb & 0x00080000) {
msg += ' No paper in the roll paper end detector\n';
}
if (asb & 0x80000000) {
msg += ' Stop the spooler\n';
}
//Display in the dialog box
alert(msg);
}

52
Chapter 3 Programming Guide (XML Print Service)

Checking the Printer Status


To check the printer status without printing, send empty print data.
Refer to the following program.

//Set the end point address


var url = 'http://192.168.192.168/cgi-bin/epos/service.cgi?devid=local_printer
&timeout=10000';
//Create an empty print document to check the printer status
var soap = '<?xml version="1.0" encoding="UTF-8"?><s:Envelope xmlns:s="http://
schemas.xmlsoap.org/soap/envelope/" ><s:Body><epos-print xmlns="http://
www.epson-pos.com/schemas/2011/03/epos-print"/></s:Body></s:Envelope>';
//Create an XMLHttpRequest object
var xhr = new XMLHttpRequest();
//<Open an XMLHttpRequest object>
xhr.open('POST', url, true);
//<Header settings>
xhr.setRequestHeader('Content-Type', 'text/xml; charset=utf-8');
xhr.setRequestHeader('If-Modified-Since', 'Thu, 01 Jan 1970 00:00:00 GMT');
xhr.setRequestHeader('SOAPAction', '""');

//Set a response reception callback function for checking


xhr.onreadystatechange = function () {
if (xhr.readyState == 4){
if (xhr.status == 200){
var res = xhr.responseXML;
var success = res.getElementsByTagName('response')[0].getAttribute('success');
if (!/^(1|true)$/.test(success)) {

}
}
alert('Success');
3
}
};

//Send empty print data


xhr.send(soap);

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!&#10;</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)

Using the Spooler Function


The spooler function is available in TM-DT Software Ver.3.0 or later/TM-i Firmware Ver.4.1 or later.
A printing job will be executed immediately and a response will be returned to the application after printing
is complete when sending a printing request to ePOS-Print Service I/F from the application when the spooler
function is disabled.

Application ePOS-Print Printer

1 : Request message()
1.1 : Cmd()
1.1.1 : Print()

1.2 : Printing results


1.3 : Response message()

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.

Application ePOS-Print Spooler Printer Forwarding printer

1 : Request message
(Print data,
printjobid="ABC123")
1.1 : send()

1.3 : Response message 1.2 : Execution result


(printjobid="ABC123",
Execution result)
2 : Cmd()
2.1 : Print()

Printing results (Failure)


3 : Cmd()
3.1 : Print()

4 : Request message Printing results (Success)


(Empty print data,
printjobid="ABC123")
4.1 : send()
4.3 : Response message
(printjobid="ABC123", 4.2 : Printing result
Printing result)

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!&#10;</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)

Acquiring the Print Job Status


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">
<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.

This section uses the following cases as examples:


• .NET Framework (p.58)
• Java (p.60)

.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)

2 Start Visual Studio and create a new project.


(Project example: console application)

3 Add a class file to the project.


(File to be added: ePOSPrint.cs)

4 Add a reference to the project.


(Assembly to be added: System.ServiceModel)

5 Edit the application configuration file.


(File to be edited: App.config)
 Open output.config and copy the <system.serviceModel> element.
 Change the end point address in accordance with the printer.

58
Chapter 3 Programming Guide (XML Print Service)

6 Create and execute a program to call XML Print Service.


Editing example (File to be edited: Program.cs)

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
ePOSPrintPortTypeClient client = new ePOSPrintPortTypeClient();

parameter param = new parameter();


param.printjobid = "ABC123";
param.devid = "local_printer";
param.timeout = "60000";

eposprint epos = new eposprint();


text t = new text();
t.align = align.center;
t.alignSpecified = true;
t.dh = true;
t.dhSpecified = true;
t.Value = "Hello, World!\n";
cut c = new cut();
c.type = cuttype.feed;
epos.Items = new object[] { t, c };

response res = client.send(ref param, epos);


Console.WriteLine(res.success);
Console.WriteLine(res.code);
Console.WriteLine(res.status);
3
Console.WriteLine(res.battery);
Console.ReadLine();
}
}
}

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

● : Available, - : Not available


*1
ePOS-Print Service Ver.2.2 or later versions supported
*2
ePOS-Print Service Ver.2.3 or later versions supported

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.

Attribute value Description


true or 1 Sets forced transmission mode.
false or 0 Sets normal transmission mode.

• Use forced transmission mode when the printer is offline.


It will result in an error if the printer is online.
• The following functions are enabled in forced transmission mode.
 Drawer kick-out (<pulse> (p.96))
 Stopping the buzzer (<sound> (p.97))
 Recovery from errors that can be recovered from (<recovery> (p.104))
 Reset (<reset> (p.105))
 Sending commands in real time (<command> (p.99))

Example

Empty printing document

<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print" />

Drawer kick-out when offline (paper end)

<epos-print xmlns= "http://www.epson-pos.com/schemas/2011/03/epos-print"


force="true">
<pulse />
</epos-print>

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.

The response timing varies depending on the printer status.


• When the power is turned ON: Time set to the TM printer
• When the power is turned OFF: Client timeout time
• When printing, return a response in the following timing:
 An error occurred: Return an error response before printing.
 Printing succeeded: Return a success response after printing.

Attribute
 success : (data type xs:boolean)
Obtains the print result.

Attribute value Description


 Printing succeeded
true or 1
 Processing succeeded (When the spooler function is enabled)
 Printing Failed
false or 0
 Processing Failed (When the spooler function is enabled)

 code : (data type xs:string)


Obtains the error code.

Attribute value Description


EPTR_AUTOMATICAL An automatically recoverable error occurred
EPTR_BATTERY_LOW
EPTR_COVER_OPEN
No remaining battery
A cover open error occurred
4
EPTR_CUTTER An autocutter error occurred
EPTR_MECHANICAL A mechanical error occurred
EPTR_REC_EMPTY No paper in roll paper end sensor
EPTR_UNRECOVERABLE An unrecoverable error occurred
SchemaError The request document contains a syntax error
DeviceNotFound The printer with the specified device ID does not exist
PrintSystemError An error occurred on the printing system
EX_BADPORT An error was detected on the communication port
EX_TIMEOUT A print timeout occurred
EX_SPOOLER * There is not enough space available in the printing queue
JobNotFound * The specified job ID does not exist
Printing * Print job now printing
*
ePOS-Print Service Ver.4.1 or later versions supported

63
 status : (data type xs:unsignedInt)
Obtains the printer status.

Attribute value Description


0x00000001 No response from the TM printer
0x00000002 Printing is successfully completed
0x00000004 Status of the 3rd pin of the drawer kick-out connector = "H"
Off line status from remaining battery
0x00000004 (only for applicable devices) (in ePOS-Print Service Ver.2.2 and
later)
0x00000008 Offline
0x00000020 The cover is open
0x00000040 Paper is being fed by a paper feed switch operation
0x00000100 Waiting to be brought back online
0x00000200 The paper feed switch is being pressed (ON)
0x00000400 A mechanical error occurred
0x00000800 An autocutter error occurred
0x00002000 An unrecoverable error occurred
0x00004000 An automatically recoverable error occurred
0x00020000 No paper in roll paper near end sensor
0x00080000 No paper in roll paper end sensor
0x01000000 A buzzer is on (only for applicable devices)
0x01000000 Waiting period for removal of label(only for applicable devices)
0x40000000 No paper in label peeling sensor (only for applicable devices)
0x80000000 * The spooler has stopped
*
ePOS-Print Service Ver.4.1 or later versions supported
 battery : (data type xs:unsignedInt)
The battery status of the printer is obtained.
0 is indicated when the model doesn't have a battery installed.
Status of power

Attribute value Description


0x30XX The AC adapter is connected
0x31XX The AC adapter is not connected

Remaining battery

Attribute value Description


0xXX36 Battery amount 6
0xXX35 Battery amount 5
0xXX34 Battery amount 4
0xXX33 Battery amount 3
0xXX32 Battery amount 2
0xXX31 Battery amount 1 (Near end)
0xXX30 Battery amount 0 (Real end)

64
Chapter 4 XML Reference

Example

When paper runs out while printing and printing fails.

<response xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print"
success="false" code="EPTR_REC_EMPTY" status="252641308"
battery="0" />

Example of printing failure when battery runs out during printing

<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:

Function (symbol) Entity Reference


& &amp;
' &apos;
> &gt;
< &lt;
" &quot;
Horizontal tab(HT) &#9; or &#x9;
Line feed (LF) &#10; or &#xA;

66
Chapter 4 XML Reference

Attribute
 lang : (data type xs:language)
Specifies the target language.

Attribute value Description


en(default) English(ANK)
de German (ANK)
fr French (ANK)
it Italian (ANK)
es Spanish (ANK)
Japanese
ja
(International character set changes to Japan.)
Japanese
ja-jp
(International character set changes to Japan.)
Korean
ko
(International character set changes to Korean.)
Korean
ko-kr
(International character set changes to Korean.)
Simplified Chinese
zh-hans *
(International character set changes to China.)
Simplified Chinese
zh-cn
(International character set changes to China.)
zh-hant * Traditional Chinese
zh-tw Traditional Chinese
Language code besides

*
above
English(ANK)

ePOS-Print Service Ver.2.2 or later versions supported


4
• Characters not installed in a printer cannot be printed.
• For printable character code, refer to the detailed instruction manual of your
printer.

Depending on language specification, a part of characters is printed as follows.

Language Characters $(U+0024) Characters \(U+005C)


Japanese $ ¥
Korean $ \
Simplified Chinese ¥ \
Traditional Chinese $ \

67
 font : (data type tns:font)
Specifies the character font.

Attribute value Description


font_a (default) Font A
font_b Font B
font_c Font C
font_d * Font D
font_e * Font E
*
ePOS-Print Service Ver.3.2 or later versions supported

When Japanese is specified, characters in Shift-JIS can be printed.

 smooth : (data type xs:boolean)


Sets smoothing. When smoothing is enabled, the print quality of characters will be
improved.

Attribute value Description


true or 1 Specifies smoothing.
false or 0 (default) Cancels smoothing

 dw : (data type xs:boolean)


Sets the double-sized width.

Attribute value Description


true or 1 Specifies the double-sized width.
false or 0 (default) Cancels the double-sized width

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.

 dh : (data type xs:boolean)


Sets the double-sized height.

Attribute value Description


true or 1 Specifies the double-sized height
false or 0 (default) Cancels the double-sized height

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.

 width : (data type tns:text-scale)


Specifies the horizontal scale.

Attribute value Description


Integer from 1 to 8
Horizontal scale
(default : 1)

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

 height : (data type tns:text-scale)


Specifies the vertical scale.

Attribute value Description


Integer from 1 to 8
Vertical scale
(default : 1)

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.

 reverse : (data type xs:boolean)


Sets the inversion of black and white parts of characters.

Attribute value Description


Specifies the inversion of black and white parts
true or 1
of characters.
Cancels the inversion of black and white parts
false or 0 (default)
of characters.

 ul : (data type xs:boolean)


Sets underlining.

Attribute value Description


true or 1 Specifies underlining.
false or 0 (default) Cancels underlining.

 em : (data type xs:boolean)


Sets emphasized printing.

Attribute value Description 4


true or 1 Specifies emphasized printing.
false or 0 (default) Cancels emphasized printing.

 color : (data type tns:color)


Specifies the character color.

Attribute value Description


none Characters are not printed.
color_1 (default) First color
color_2 Second color
color_3 Third color
color_4 Fourth color

 x: (data type xs:unsignedShort Default : 0)


Specifies the print start position of the text in dots. 
In page mode, this specification is the same as the specification for the horizontal print
position by the position element, but the print position in the horizontal direction only
will be moved.

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.

Use this attribute inside the page element.

 align : (data type tns:align)


Specifies the alignment.

Attribute value Description


left (default) Alignment to the left
center Alignment to the center
right Alignment to the right

• 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.

 rotate : (data type xs:boolean)


Sets rotated printing of text.

Attribute value Description


true or 1 Specifies rotated printing of text.
false or 0 (default) Cancels rotated printing of text.

• In page mode, even if rotate is specified, it is disabled.


For the page mode, set the print direction as right to left (right_to_left) using the direction
element to perform 180-degree rotated printing of text.
• The rotate attribute set in this element also applies to the rotate attribute in each of the
barcode and symbol elements.

 linespc : (data type xs:unsignedShort Default : 30)


Specifies the per-line paper feed amount in dots.

70
Chapter 4 XML Reference

Example

To print a character string based on the following settings:

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!&#10;</text>
</epos-print>

Examples for setting the language


 To set the language as Korean:

<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<text lang="ko" />
</epos-print>

 To set the language as Simplified Chinese:

<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
4
<text lang="zh-hans" />
</epos-print>

 To set the language as Traditional Chinese:

<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).

Attribute value Description


peeling Paper feed to the peeling position
cutting Paper feed to the cutting position
current_tof Paper feed to the head position of current label
next_tof Paper feed to the head position of next label

• 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

To feed paper 3 lines forward:

<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<feed line="3" />
</epos-print>

To start a new line after printing a character string:

<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<text>Hello</text><feed />
<text>World</text><feed />
</epos-print>

To print while peeling the label one by one

<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>

To print labels consecutively

<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>

To print tickets with black mark paper

<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.

Attribute value Description


none Characters are not printed.
color_1 (default) First color
color_2 Second color
color_3 Third color
color_4 Fourth color

74
Chapter 4 XML Reference

 align : (data type tns:align)


Specifies the print position.

Attribute value Description


left (default) Alignment to the left
center Alignment to the center
right Alignment to the right

The align attribute set in this element also applies to the align attribute in each of the text,
logo, barcode, and symbol elements.

 mode : (Optional attribute, data type tns:image-mode)


Specifies the color mode.

Attribute value Description


mono (default) Monochrome (two-tone)
gray16 Multiple tones (16-tone)

Example

To print an 8 dot wide, 8 dot high filled-in raster image:

<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.

Attribute value Description


left (default) Alignment to the left
center Alignment to the center
right Alignment to the right

The align attribute set in this element also applies to the align attribute in each of the text,
image, barcode, and symbol elements.

Example

To print a NV logo with key1 registered as 48 and key2 registered as 48:

<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:

Barcode type Barcode data specification procedure


When an 11-digit number is specified, a check digit is automatically
added.
UPC-A
When a 12-digit number is specified, the 12th digit is processed as a
check digit but the check digit is not validated.
Specify 0 as the first digit.
Specify the manufacturer code in the digits 2 to 6.
Specify (right-align) the item code in the digits 7 to 11. The number of
item code digits varies depending on the manufacturer code. Specify
UPC-E 0s in empty digits.
When an 11-digit number is specified, a check digit is automatically
added.
When a 12-digit number is specified, the 12th digit is processed as a
check digit but the check digit is not validated.
4
EAN13 When an 12-digit number is specified, a check digit is automatically
added.
JAN13 When a 13-digit number is specified, the 12th digit is processed as a
check digit but the check digit is not validated.
EAN8 When a 7-digit number is specified, a check digit is automatically
added.
JAN8 When an 8-digit number is specified, the 8th digit is processed as a
check digit but the check digit is not validated.
When the first character is *, the character is processed as the start
CODE39
character. In other cases, a start character is automatically added.
Start and stop codes are automatically added.
ITF
Check digits are not added or validated.
Specify a start character (A to D, a to d).
CODABAR Specify a stop character (A to D, a to d).
Check digits are not added or validated.
Start and stop characters are automatically added.
CODE93
A check digit is automatically calculated and added.

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.

Attribute value Description


upc_a UPC-A
upc_e UPC-E
ean13 EAN13
jan13 JAN13
ean8 EAN8
jan8 JAN8
code39 CODE39
itf ITF
codabar CODABAR
code93 CODE93
code128 CODE128
gs1_128 GS1-128
gs1_databar_omnidirectional GS1 DataBar Omnidirectional
gs1_databar_truncated
gs1_databar_limited
GS1 DataBar Truncated
GS1 DataBar Limited 4
gs1_databar_expanded GS1 DataBar Expanded

 hri : (data type tns:barcode-hri)


Specifies the HRI position.

Attribute value Description


none (default) HRI not printed
above Above the bar code
below Below the bar code
both Both above and below the bar code

 font : (data type tns:font)


Specifies the HRI font.

Attribute value Description


font_a (default) Font A
font_b Font B
font_c Font C
font_d * Font D
font_e * Font E
*
ePOS-Print Service Ver.3.2 or later versions supported

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.

Attribute value Description


left (default) Alignment to the left
center Alignment to the center
right Alignment to the right

The align attribute set in this element also applies to the align attribute in each of the text,
image, logo, and symbol elements.

 rotate : (data type xs:boolean)


Specifies the rotate printing.

Attribute value Description


true or 1 Specifies rotated printing of text.
false or 0 (default) Cancels rotated printing of text.

• 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.

Attribute value Type


pdf417_standard Standard PDF417
pdf417_truncated Truncated PDF417
qrcode_model_1 QR Code Model 1
qrcode_model_2 QR Code Model 2
qrcode_micro *2 Micro QR Code
maxicode_mode_2 MaxiCode Mode 2
maxicode_mode_3 MaxiCode Mode 3
maxicode_mode_4 MaxiCode Mode 4
maxicode_mode_5 MaxiCode Mode 5
maxicode_mode_6 MaxiCode Mode 6
gs1_databar_stacked GS1 DataBar Stacked
gs1_databar_stacked_omnidirectional GS1 DataBar Stacked Omnidirectional
gs1_databar_expanded_stacked GS1 DataBar Expanded Stacked
azteccode_fullrange *1 Aztec Code Full-Range Mode
azteccode_compact *1 Aztec Code Compact Mode
datamatrix_square *1 DataMatrix ECC200 square
datamatrix_rectangle_8 *1 DataMatrix ECC200 rectangle, 8 lines
datamatrix_rectangle_12 *1 DataMatrix ECC200 rectangle, 12 lines
datamatrix_rectangle_16 *1 DataMatrix ECC200 rectangle, 16 lines

*1 ePOS-Print Service Ver.2.2 or later versions supported


*2 ePOS-Print Service Ver.4.1 or later versions supported

82
Chapter 4 XML Reference

 level : (data type tns:symbol-level)


Specifies the error correction level.

Attribute value Description


level_0 PDF417 error correction level 0
level_1 PDF417 error correction level 1
level_2 PDF417 error correction level 2
level_3 PDF417 error correction level 3
level_4 PDF417 error correction level 4
level_5 PDF417 error correction level 5
level_6 PDF417 error correction level 6
level_7 PDF417 error correction level 7
level_8 PDF417 error correction level 8
level_l QR Code error correction level L
level_m QR Code error correction level M
level_q QR Code error correction level Q
level_h QR Code error correction level H
Integer from 5 to 95 * Aztec Code error correction level (Default : 23)
default Default level

* ePOS-Print Service Ver.2.2 or later versions supported


v

• Select the level according to the 2D-code type.


• Select the default for MaxiCode and two-dimensional GS1 DataBar.
• Micro QR Code does not support level_h.

 width : (data type xs:unsignedByte)


Specifies the width of each module in dots. 4
2D-Code Type Valid value range Default
PDF417 2 to 8 width="3"
QR Code 3 to 16 width="3"
MaxiCode Ignored
2-dimentional GS1
2 to 8 width="2"
DataBar
Aztec Code 2 to 16 width="3"
DataMatrix 2 to 16 width="3"

83
 height : (data type xs:unsignedByte)
Specifies the height of each module.

2D-Code Type Valid value range Default


2 to 8
PDF417 height="3"
(Magnification for width)
QR Code
MaxiCode
GS1 DataBar Ignored
Aztec Code
DataMatrix

 size : (data type xs:unsignedShort)

2D-Code Default Description


Specifies the number of code
PDF417 size="0"
words for each row
QR Code
Ignored
MaxiCode
2-dimentional GS1 DataBar
Specifies the maximum width for
Expanded Stacked size=”0” (auto) the barcode
(106 or above)
Others Ignored
Aztec Code
Ignored
DataMatrix

 align : (data type tns:align)


Specifies the print position.

Attribute value Description


left (default) Alignment to the left
center Alignment to the center
right Alignment to the right

The align attribute set in this element also applies to the align attribute in each of the text,
image, logo, and barcode elements.

 rotate : (data type xs:boolean)


Specifies the rotate printing.

Attribute value Description


true or 1 Specifies rotated printing of text.
false or 0 (default) Cancels rotated printing of text.

• 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.

Cannot be written in the <page> tag.

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.

Attribute value Description


thin(default) Solid line: Thin
medium Solid line: Medium
thick Solid line: Thick
thin_double Double line: Thin
medium_double Double line: Medium
thick_double Double line: Thick

Example

To draw double lines in the following positions:


 From the left end: 100th dot to 200th dot
 From the left end: 400th dot to 500th dot

<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.

Attribute value Description


thin(default) Solid line: Thin
medium Solid line: Medium
thick Solid line: Thick
thin_double Double line: Thin
medium_double Double line: Medium
thick_double Double line: Thick

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.

Attribute value Description


thin(default) Solid line: Thin
medium Solid line: Medium
thick Solid line: Thick
thin_double Double line: Thin
medium_double Double line: Medium
thick_double Double line: Thick

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.

Elements via <page>


Via <page>, the following elements can be used.

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

To print "ABCDE" in page mode:

<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

• Use this element inside the page element.


• Specify the print area according to the print content. If print data extends beyond the print area,
the print result is such that the whole data cannot be printed completely.

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.

Use this element inside the page element.

Attribute
 dir : (Required attribute, data type tns:page-dir)
Specifies the rotation direction.

Attribute value Description


Left to right
left_to_right (default) (No rotation.Data is printed from the top left corner to
the right.)
Bottom to top
bottom_to_top (Counterclockwise rotation by 90 degrees.
Data is printed from the bottom left corner to the top.)
Right to left
right_to_left (Rotation by 180 degrees.Data is printed from the bot-
tom right corner to the left.)
Top to bottom
top_to_bottom (Clockwise rotation by 90 degrees.
Data is printed from the top right corner to the bottom.) 4
Example

To print the characters "ABCDE" by rotating them 90 degrees clockwise:

<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.

Use this element inside the page element.

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.

• Use this element inside the page element.


• Diagonal lines cannot be drawn.

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.

Attribute value Description


thin Solid line: Thin
medium Solid line: Medium
thick Solid line: Thick
thin_double Double line: Thin
medium_double
thick_double
Double line: Medium
Double line: Thick
4
Example

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.

• Use this element inside the page element.


• Not available in standard mode. Use the hline, vline-begin, and vline-end elements instead.

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.

Attribute value Description


thin Solid line: Thin
medium Solid line: Medium
thick Solid line: Thick
thin_double Double line: Thin
medium_double Double line: Medium
thick_double Double line: Thick

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.

• Cannot be written in the <page> tag.


• Execute "when at the top of a line".

Attribute
 type : (data type tns:cut-type)
Specifies the paper cut type.

Attribute value Description


no_feed Cut without feeding
(The paper is cut without being fed.)
feed Feed cut
(The paper is fed to the cut position and then is cut.)
reserve Cut reservation
(Printing continues until the cut position is reached, at
which the paper is cut.)

Example

To perform feed cut operation:

<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.

• Cannot be written in the <page> tag.


• The drawer and the buzzer cannot be used together.

Attribute
 drawer : (data type tns:pulse-drawer)
Specifies the drawer kick connector.

Attribute value Description


drawer_1 Pin 2 of the drawer kick-out connector
drawer_2 Pin 5 of the drawer kick-out connector

 time : (data type tns:pulse-time)


Specifies the ON time of the drawer kick signal.

Attribute value Description


pulse_100 100 ms
pulse_200 200 ms
pulse_300 300 ms
pulse_400 400 ms
pulse_500 500 ms

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.

• Cannot be written in the <page> tag.


• The buzzer function and the drawer cannot be used together.
• This element is not available if the printer is not provided with the buzzer.

Attribute
 pattern : (data type tns:sound-pattern)
Specifies the buzzer pattern.

Attribute value Description


none Stop
pattern_a Pattern A
pattern_b Pattern B
pattern_c Pattern C
pattern_d Pattern D
pattern_e Pattern E
error Error sound pattern
paper_end Pattern when there is no paper
pattern_1 * Pattern 1
pattern_2 * Pattern 2
pattern_3 * Pattern 3
pattern_4 * Pattern 4
pattern_5 *
pattern_6 *
Pattern 5
Pattern 6
4
pattern_7 * Pattern 7
pattern_8 * Pattern 8
pattern_9 * Pattern 9
pattern_10 * Pattern 10
*
ePOS-Print Service Ver.2.2 or later versions supported
 repeat : (data type xs:unsignedByte, When not specified : 1)
Specifies the number of repeats.

Attribute value Description


0 The buzzer does not stop.
1 to 255 Number of repeats

 cycle : (data type xs:unsignedByte, When not specified : 1000) 


(in ePOS-Print Service Ver.2.2 and later)
Specifies the buzzer sounding cycle (in units of milliseconds)

"cycle" is enabled by any of "pattern_1" to "pattern_10" for the buzzer pattern.

97
Example

To repeat the sound pattern A three times:

<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)

Refer to the following URL for details of the ESC/POS command.


https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=2

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)

Cannot be written in the <page> tag.

Attribute
 type : (data type tns:layout-type)
Specifies the paper type.

Attribute value Description


receipt (default) Receipt (without black mark)
receipt_bm Receipt (with black mark)
label Die-cut label (without black mark)
label_bm Die-cut label (with black mark)

 width : (data type xs:unsignedShort, When not specified : 580)


Specifies paper width (in units of 0.1 mm). Specifies an integer from 290 to 600. *
 height : (data type xs:unsignedShort, When not specified : 0)
Specifies paper height (in units of 0.1 mm).

Paper Type Valid value range Description


Receipt 
0 Setup not necessary
(without black mark)
Distance from the top of black mark to
Receipt (with black mark)
the top of next black mark
Die-cut label  0 (auto) Distance from the top of label to the
(without black mark) 284 to 1550 (manual) * top of next label
Die-cut label Distance from the bottom of black
(with black mark) mark to the bottom of next black mark

 margin-top : (data type xs:Short, When not specified : 0)


Specifies top margin (in units of 0.1 mm).

Paper Type Valid value range Description


Receipt 
0 Setup not necessary
(without black mark)
Receipt (with black mark) -150 to 1500 * Distance from the top of black mark
Die-cut label 
0 to 1500 * Distance from the top of label
(without black mark)
Die-cut label Distance from the bottom of black
-15 to 1500 *
(with black mark) mark

100
Chapter 4 XML Reference

 margin-bottom :(data type xs:Short, When not specified : 0)


Specifies bottom margin (in units of 0.1 mm).

Paper Type Valid value range Description


Receipt 
0
(without black mark) Setup not necessary
Receipt (with black mark) 0
Distance from the bottom of label
Die-cut label 
-15 to 0 * (paper feed direction is a positive
(without black mark)
number)
Distance from the top of black mark
Die-cut label
-15 to 15 * (paper feed direction is a positive
(with black mark)
number)

 offset-cut : (data type xs:Short)


Specifies cut position (in units of 0.1 mm).
In case of die cut label paper, it is a distance from the bottom of label.
When a paper has black mark, it is a distance from the beginning of black mark.

Paper Type Valid value range Description


Receipt 
0 Setup not necessary
(without black mark)
Distance from the top of black mark to
Receipt (with black mark) -290 to 50 *
the cutting position
Die-cut label  Distance from the bottom of label to the
0 to 50 *
(without black mark) cutting position
Die-cut label Distance from the top of black mark to
0 to 50 *
(with black mark)

 offset-label : (data type xs:Short, When not specified : 0)


the cutting position
4
Specifies label bottom position (sd) per 0.1 mm unit.

Paper Type Valid value range Description


Receipt 
0
(without black mark)
Receipt (with black mark) 0 Setup not necessary
Die-cut label 
0
(without black mark)
Die-cut label Distance from the top of black mark to
0 to 15 *
(with black mark) the bottom of label

*: 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

<without Black Mark> <with Black Mark>


sf sf
sb
Top position
sc

Cut

Receipt sa

sc

sf sf

sb Cut sb

Top position Top position

Label sa Bottom edge se sa


se
Bottom edge of print area sd
Cut of print area Standard eject

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.

To set 58 mm receipt (without black mark):

<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">
<layout type="receipt" width="580" />
</epos-print>

To set 58 mm receipt (with black mark):

<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>

To set 58 mm die-cut label (without black mark):

<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>

To set 58 mm die-cut label (with black mark):

<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>

Setting label paper in TM-P Series printers 4


For TM-P Series printers (except TM-P60), before printing labels, it is necessary to set the label size and feed
label paper. Perform control by referring to the following:

<epos-print xmlns="http://www.epson-pos.com/schemas/2011/03/epos-print">

<!-- Set the paper layout. -->


<!-- Die-cut label paper, mount width: 58.0 mm, height: automatic -->
<!-- Top margin: 1.5 mm from label edge, bottom margin: 1.5 mm from label bottom edge -->
<!-- Cut position: 2.5 mm from label bottom edge -->
<layout type="label" width="580" height="0" margin-top="15"
margin-bottom="-15" offset-cut="25" offset-label="0"/>

<!-- Feeds to the top of the label. -->


<feed pos="next_tof"/>

</epos-print>

103
<recovery>
Recovers from an error. (in ePOS-Print Service Ver.3.0 and later)

• Cannot be written in the <page> tag.


• Recovers from errors that can be recovered from and clears the buffer.
Enable forced transmission mode (p. 62) to use this element.

Example

Recovers from errors that can be recovered from and clears the buffer.

<epos-print xmlns= "http://www.epson-pos.com/schemas/2011/03/epos-print"


force="true">
<recovery />
</epos-print>

104
Chapter 4 XML Reference

<reset>
Resets the printer. (in ePOS-Print Service Ver.3.0 and later)

• Cannot be written in the <page> tag.


• Other printing commands in the print document are ignored.

Example

Resets the printer

<epos-print xmlns= "http://www.epson-pos.com/schemas/2011/03/epos-print">


<reset />
</epos-print>

105
Support Information by Printer
Model Page Model Page Model Page

TM-H6000IV-DT p. 106 TM-L90-i p. 108 TM-L90 p. 108

TM-P20 p. 110 TM-P60II p. 112 TM-P60II with Peeler p. 112

TM-P80 p. 114 TM-T20 p. 116 TM-T20II-i p. 117

TM-T20II p. 117 TM-T70-i p. 119 TM-T70 p. 119

TM-T70-i TM-T70
p. 121 p. 121 TM-T70II-DT p. 123
Multi-language model Multi-language model

TM-T70II p. 123 TM-T82II-i p. 125 TM-T82II p. 125

TM-T83II-i p. 127 TM-T83II p. 127 TM-T88IV p. 129

TM-T88V-DT p. 131 TM-T88V-i p. 131 TM-T88V p. 131

TM-T90 p. 133 TM-U220-i p. 135 TM-U220 p. 135

TM-H6000IV-DT

Receipt

80 mm 58 mm

Resolution 180 x 180 dpi

Print Width 512 dots

Characters in a Line Font A ANK: 42 characters ANK: 30 characters

Font B ANK: 56 characters ANK: 40 characters

Character Size Font A ANK: 12 dots x 24 dots (W x H)

Font B ANK: 9 dots x 17 dots (W x H)

Character Baseline Font A At the 21st dot from the top of the character

Font B At the 16th dot from the top of the character

Default Line Feed Space 30 dots

Color Specification First color

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)

Raster Image <image> Monochrome image, Gray scale image

Logo <logo> Monochrome image, Gray scale image

106
Chapter 4 XML Reference

Receipt

80 mm 58 mm

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, Composite Symbology

Ruled Line <hline>, Not supported


<vline-begin>, <vline-end>

Page Mode Line <line> Not supported

Rectangle
<rectangle>

Paper Cut <cut> Cut, Feed cut

Drawer Kick-Out <pulse> Supported

Buzzer <sound> Not supported

Paper Layout Settings <layout> Not supported

Command <command> Supported


4

107
TM-L90-i/ TM-L90

Receipt Die-cut Label

Resolution 203 dpi x 203 dpi (W x H)

Print Width 256 dots (38 mm) to 224 dots (38 mm) to
576 dots (80 mm) 560 dots (80 mm)

Characters in a Line Font A ANK: 48 characters, ANK: 46 characters

Font B ANK: 57 characters ANK: 56 characters

Font C ANK: 72 characters ANK: 70 characters

Character Size Font A ANK: 12 dots x 24 dots (W x H)

Font B ANK: 10 dots x 24 dots (W x H)

Font C ANK: 8 dots x 16 dots (W x H)

Character Baseline Font A At the 21st dot from the top of the character

Font B At the 21st dot from the top of the character

Font C At the 15st dot from the top of the character

Default Line Feed Space 30 dots

Color Specification First color


Second color, Second color (when two-color printing is set)

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

Raster Image <image> Monochrome image, Two color image

Logo <logo> Monochrome image, Two color image


(To perform two-color printing, change the settings of the printer
using the memory switch setting utility.)

Barcode <barcode> UPC-A, UPC-E, EAN13, JAN13, EAN8, JAN8, CODE39, ITF,
CODABAR, CODE93, CODE128

2D-Code <symbol> PDF417, QR Code, MaxiCode

Ruled Line <hline>, Not supported


<vline-begin>, <vline-end>

108
Chapter 4 XML Reference

Receipt Die-cut Label

Page Mode Line <line> Not supported

Rectangle
<rectangle>

Paper Cut <cut> Cut, Feed cut

Drawer Kick-Out <pulse> Supported

Buzzer <sound> Not supported

Paper Layout Settings <layout> Not supported (With automatic setup mode)

Command <command> Supported

ePOS-Print Setting (TM-L90)

Item Value

Printing Method Thermal (203 dpi)

Character Code Tables Page 0-5, 16-19

109
TM-P20

58 mm

Resolution 203 dpi x 203 dpi (W x H)

Print Width 384 dots

Characters in a Line Font A ANK: 32 characters

Font B ANK: 42 characters

Font C ANK: 42 characters

Font D ANK: 38 characters

Font E ANK: 48 characters

Character Size Font A ANK: 12 dots x 24 dots (W x H)

Font B ANK: 9 dots x 24 dots (W x H)

Font C ANK: 9 dots x 17 dots (W x H)

Font D ANK: 10 dots x 24 dots (W x H)

Font E ANK: 8 dots x 16 dots (W x H)

Character Baseline Font A At the 21st dot from the top of the character

Font B At the 16th dot from the top of the character

Font C At the 16th dot from the top of the character

Font D At the 21st dot from the top of the character

Font E At the 15th dot from the top of the character

Default Line Feed Space 30 dots

Color Specification First color

Page Mode Default Area 384 dots x 2400 dots (W x H)

Page Mode Maximum Area 384 dots x 2400 dots (W x H)

Raster Image <image> Monochrome image

Logo <logo> Monochrome image

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, Composite Symbology

Ruled Line <hline>, Not supported


<vline-begin>, <vline-end>

110
Chapter 4 XML Reference

58 mm

Page Mode Line <line> Supported (Only solid line)

Rectangle
<rectangle>

Paper Cut <cut> Feeds paper to cutting position

Drawer Kick-Out <pulse> Not supported

Buzzer <sound> Supported

Paper Layout Settings <layout> Supported

Command <command> Supported

111
TM-P60II/ TM-P60II with Peeler

Receipt Die-cut label

Resolution 203 dpi x 203 dpi (W x H)

Print Width 432 dots 160 dots ~ 400 dots

Characters in a Line Font A ANK: 36 characters ANK: 33 characters

Font B ANK: 43 characters ANK: 40 characters

Font C ANK: 54 characters ANK: 50 characters

Character Size Font A ANK: 12 dots x 24 dots (W x H)

Font B ANK: 10 dots x 24 dots (W x H)

Font C ANK: 8 dots x 16 dots (W x H)

Character Baseline Font A At the 21st dot from the top of the character

Font B At the 21st dot from the top of the character

Font C At the 15th dot from the top of the character

Default Line Feed Space 30 dots

Color Specification First color

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)

Raster Image <image> Monochrome image

Logo <logo> Monochrome image

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)

Ruled Line <hline>, Not supported


<vline-begin>, <vline-end>

Page Mode Line <line> Supported (Only solid line)

Rectangle
<rectangle>

Paper Cut <cut> Feed cut (Feeds paper to cutting position)

Drawer Kick-Out <pulse> Not supported

Buzzer <sound> Support (Pattern 1 ~ Pattern 10, Stop)

112
Chapter 4 XML Reference

Receipt Die-cut label

Paper Layout Settings <layout> Supported

Command <command> Supported

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

height (sa) 0 0, 284 to 1550 0, 284 to 1550 0, 284 to 1550

margin_top (sb) 0 -130 to 1500 0 to 1500 -15 to 1500

margin_bottom (se) 0 0 -15 to 0 -15 to 15

offset_cut (sc) 0 -256 to 50 0 to 50 0 to 50

offset_label (sd) 0 0 0 0 to 15

113
TM-P80

80 mm

Resolution 203 dpi x 203 dpi (W x H)

Print Width 576 dots

Characters in a Line Font A ANK: 48 characters

Font B ANK: 64 characters

Character Size Font A ANK: 12 dots x 24 dots (W x H)

Font B ANK: 9 dots x 17 dots (W x H)

Character Baseline Font A At the 21st dot from the top of the character

Font B At the 16th dot from the top of the character

Default Line Feed Space 30 dots

Color Specification First color

Page Mode Default Area 576 dots x 1662 dots (W x H)

Page Mode Maximum Area 576 dots x 1662 dots (W x H)

Raster Image <image> Monochrome image

Logo <logo> Monochrome image

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, Data Matrix, Aztec Code,


GS1 DataBar Stacked, 
GS1 DataBar Stacked Omnidirectional,
GS1 DataBar Expanded Stacked, Composite Symbology

Ruled Line <hline>, Not supported


<vline-begin>, <vline-end>

Page Mode Line <line> Not supported

Rectangle
<rectangle>

Paper Cut <cut> Feed

Drawer Kick-Out <pulse> Not supported

Buzzer <sound> Supported

Paper Layout Settings <layout> Supported

Command <command> Supported

114
Chapter 4 XML Reference

Paper Layout
Receipt paper Receipt paper
Paper type
(without black mark) (with black mark)

width (sf) 800 800

height (sa) 0 0, 284 to 3100

margin_top (sb) 0 -98 to 3100

margin_bottom (se) 0 0

offset_cut (sc) 0 -173 to 50

offset_label (sd) 0 0

115
TM-T20

58 mm 80 mm

Resolution 203 dpi x 203 dpi (W x H)

Print Width 420 dots 576 dots

Characters in a Line Font A ANK: 35 characters, ANK: 48 characters

Font B ANK: 46 characters ANK: 64 characters

Character Size Font A ANK: 12 dots x 24 dots (W x H)

Font B ANK: 9 dots x 17 dots (W x H)

Character Baseline Font A At the 21st dot from the top of the character

Font B At the 16th dot from the top of the character

Default Line Feed Space 30 dots

Color Specification First color

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)

Raster Image <image> Monochrome image

Logo <logo> Monochrome image

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)

Ruled Line <hline>, Not supported


<vline-begin>, <vline-end>

Page Mode Line <line> Not supported

Rectangle
<rectangle>

Paper Cut <cut> Cut, Feed cut

Drawer Kick-Out <pulse> Supported

Buzzer <sound> Supported (Pattern A ~ Pattern E, Error, No paper, Stop)

Paper Layout Settings <layout> Not supported

Command <command> Supported

116
Chapter 4 XML Reference

TM-T20II-i/ TM-T20II

58 mm 80 mm

Resolution 203 dpi x 203 dpi (W x H)

Print Width 420 dots 576 dots


(42 Column Mode) (378 dots) (546 dots)

Characters in a Line Font A ANK: 35 characters ANK: 48 characters

(42 Column Mode) (ANK: 42 characters) (ANK: 42 characters)

Font B ANK: 46 characters ANK: 64 characters

(42 Column Mode) (ANK: 31 characters) (ANK: 60 characters)

Character Size Font A ANK: 12 dots x 24 dots (W x H)

(42 Column Mode) (ANK: 9 dots x 17 dots) (ANK: 13 dots x 24 dots)

Font B ANK: 9 dots x 17 dots (W x H)

(42 Column Mode) (ANK: 12 dots x 24 dots) (ANK: 9 dots x 17 dots)

Character Baseline Font A At the 21st dot from the top of the character

Font B At the 16th dot from the top of the character

Default Line Feed Space 30 dots

Color Specification

Page Mode Default Area


First color

420 dots x 831 dots (W x H) 576 dots x 831 dots (W x H)


4
Page Mode Maximum Area 420 dots x 1662 dots (W x H) 576 dots x 1662 dots (W x H)

Raster Image <image> Monochrome image

Logo <logo> Monochrome image

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, Composite Symbology

Ruled Line <hline>, Not supported


<vline-begin>, <vline-end>

Page Mode Line <line> Not supported

Rectangle
<rectangle>

Paper Cut <cut> Cut, Feed cut

Drawer Kick-Out <pulse> Supported

117
58 mm 80 mm

Buzzer <sound> Supported

Paper Layout Settings <layout> Not supported

Command <command> Supported

ePOS-Print Setting (TM-T20II)

Item Value

Printing Method Thermal (203 dpi)

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

Resolution 203 dpi x 203 dpi (W x H)

Print Width 420 dots 576 dots

Characters in a Line Font A ANK: 34 characters ANK: 48 characters

Font B ANK: 46 characters ANK: 64 characters

Character Size Font A ANK: 12 dots x 24 dots (W x H)

Font B ANK: 8 dots x 16 dots (W x H)

Character Baseline Font A At the 21st dot from the top of the character

Font B At the 15th dot from the top of the character

Default Line Feed Space 30 dots

Color Specification First color

Page Mode Default Area 576 dots x 1662 dots (W x H)

Page Mode Maximum Area 576 dots x 1662 dots (W x H)

Raster Image <image> Monochrome image

Logo <logo> Monochrome image

Barcode <barcode> UPC-A, UPC-E, EAN13, JAN13, EAN8, JAN8, CODE39, ITF,
CODABAR, CODE93, CODE128
4
2D-Code <symbol> PDF417, QR Code

Ruled Line <hline>, Not supported


<vline-begin>, <vline-end>

Page Mode Line <line> Not supported

Rectangle
<rectangle>

Paper Cut <cut> Cut, Feed cut

Drawer Kick-Out <pulse> Supported

Buzzer <sound> Not supported

Paper Layout Settings <layout> Not supported

Command <command> Supported

119
ePOS-Print Setting (TM-T70)

Item Value

Printing Method Thermal (180 dpi)

Character Code Tables Page 0-5, 16-19

120
Chapter 4 XML Reference

TM-T70-i/ TM-T70 (Multi-language model)

80 mm

Resolution 203 dpi x 203 dpi (W x H)

Print Width 576 dots

Characters in a Line Font A ANK: 48 characters

Font B ANK: 64 characters

Character Size Font A ANK: 12 dots x 24 dots (W x H)

Font B ANK: 9 dots x 17 dots (W x H)

Character Baseline Font A At the 21st dot from the top of the character

Font B At the 16th dot from the top of the character

Default Line Feed Space 30 dots

Color Specification First color

Page Mode Default Area 576 dots x 1662 dots (W x H)

Page Mode Maximum Area 576 dots x 1662 dots (W x H)

Raster Image <image> Monochrome image

Logo <logo> Monochrome image

Barcode <barcode> UPC-A, UPC-E, EAN13, JAN13, EAN8, JAN8, CODE39, ITF,
CODABAR, CODE93, CODE128
4
2D-Code <symbol> PDF417, QR Code

Ruled Line <hline>, Not supported


<vline-begin>, <vline-end>

Page Mode Line <line> Not supported

Rectangle
<rectangle>

Paper Cut <cut> Cut, Feed cut

Drawer Kick-Out <pulse> Supported

Buzzer <sound> Not supported

Paper Layout Settings <layout> Not supported

Command <command> Supported

121
ePOS-Print Setting (TM-T70)

Item Value

Printing Method Thermal (203 dpi)

Character Code Tables Page 0-5, 16-19

122
Chapter 4 XML Reference

TM-T70II-DT/ TM-T70II

80 mm

Resolution 203 dpi x 203 dpi (W x H)

Print Width 576 dots

Characters in a Line Font A ANK: 48 characters

Font B ANK: 72 characters

Character Size Font A ANK: 12 dots x 24 dots (W x H)

Font B ANK: 9 dots x 17 dots (W x H)

Character Baseline Font A At the 21st dot from the top of the character

Font B At the 15th dot from the top of the character

Default Line Feed Space 30 dots

Color Specification First color

Page Mode Default Area 576 dots x 1662 dots (W x H)

Page Mode Maximum Area 576 dots x 1662 dots (W x H)

Raster Image <image> Monochrome image

Logo <logo> Monochrome image

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

2D-Code <symbol> PDF417, QR Code, MaxiCode, GS1 DataBar Stacked,


GS1 DataBar Stacked Omnidirectional, GS1 DataBar Expanded
Stacked

Ruled Line <hline>, Not supported


<vline-begin>, <vline-end>

Page Mode Line <line> Not supported

Rectangle
<rectangle>

Paper Cut <cut> Cut, Feed cut

Drawer Kick-Out <pulse> Supported

Buzzer <sound> Supported

Paper Layout Settings <layout> Not supported

Command <command> Supported

123
ePOS-Print Setting

Item Value

Printing Method Thermal (203 dpi)

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

Resolution 203 dpi x 203 dpi (W x H)

Print Width 576 dots


(42 Column Mode) (546 dots)

Characters in a Line Font A ANK: 48 characters

(42 Column Mode) (ANK: 42 characters)

Font B ANK: 64 characters

(42 Column Mode) (ANK: 60 characters)

Character Size Font A ANK: 12 dots x 24 dots (W x H)

(42 Column Mode) (ANK: 13 dots x 24 dots)

Font B ANK: 9 dots x 17 dots (W x H)

(42 Column Mode) (ANK: 9 dots x 17 dots)

Character Baseline Font A At the 21st dot from the top of the character

Font B At the 16th dot from the top of the character

Default Line Feed Space 30 dots

Color Specification

Page Mode Default Area


First color

576 dots x 831 dots (W x H)


4
Page Mode Maximum Area 576 dots x 1662 dots (W x H)

Raster Image <image> Monochrome image

Logo <logo> Monochrome image

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, Composite Symbology

Ruled Line <hline>, Not supported


<vline-begin>, <vline-end>

Page Mode Line <line> Not supported

Rectangle
<rectangle>

Paper Cut <cut> Cut, Feed cut

Drawer Kick-Out <pulse> Supported

125
80 mm

Buzzer <sound> Supported

Paper Layout Settings <layout> Not supported

Command <command> Supported

126
Chapter 4 XML Reference

TM-T83II-i/ TM-T83II

80 mm

Resolution 180 dpi x 180 dpi (W x H)

Print Width 512 dots

Characters in a Line Font A ANK: 42 characters


Kanji: 21 characters

Font B ANK: 56 characters


Kanji: 32 characters

Character Size Font A ANK: 12 dots x 24 dots (W x H)


Kanji: 24 dots x 24 dots (W x H)

Font B ANK: 9 dots x 17 dots (W x H)


Kanji: 16 dots x 16 dots (W x H)

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

Default Line Feed Space 30 dots

Color Specification First color

Page Mode Default Area

Page Mode Maximum Area


512 dots x 1662 dots (W x H)

512 dots x 1662 dots (W x H)


4
Raster Image <image> Monochrome image

Logo <logo> Monochrome image

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

Ruled Line <hline>, Not supported


<vline-begin>, <vline-end>

Page Mode Line <line> Not supported

Rectangle
<rectangle>

Paper Cut <cut> Cut, Feed cut

Drawer Kick-Out <pulse> Supported

127
80 mm

Buzzer <sound> Supported

Paper Layout Settings <layout> Not supported

Command <command> Supported

128
Chapter 4 XML Reference

TM-T88IV

80 mm 58 mm
Resolution 180 dpi x 180 dpi (W x H)

Print Width 512 dots 360 dots

Characters in a Line Font A ANK: 42 characters ANK: 30 characters

Font B ANK: 56 characters ANK: 40 characters

Character Size Font A ANK: 12 dots x 24 dots (W x H)

Font B ANK: 9 dots x 17 dots (W x H)

Character Baseline Font A At the 21st dot from the top of the character

Font B At the 16th dot from the top of the character

Default Line Feed Space 30 dots

Color Specification First color


First color, Second color (when two-color printing is set)

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

Raster Image <image> Monochrome image, two-color image

Logo <logo> Monochrome image, two-color image


(To perform two-color printing, change the settings of the printer
using the memory switch setting utility.)

Bar Code UPC-A, UPC-E, EAN13, JAN13, EAN8, JAN8, CODE39, ITF,
CODABAR, CODE93, CODE128, GS1-128

2D-Code <symbol> PDF417, QR Code

Ruled Line <hline>, Not supported


<vline-begin>, <vline-end>

Page Mode Line <line> Not supported

Rectangle
<rectangle>

Paper Cut <cut> Cut, Feed cut

Drawer Kick-Out <pulse> Supported

Buzzer <sound> Not supported

Paper Layout Settings <layout> Not supported

129
80 mm 58 mm
Command <command> Supported

ePOS-Print Setting

Item Value

Printing Method Thermal (180 dpi)

Character Code Tables Page 0-5, 16-19

130
Chapter 4 XML Reference

TM-T88V-DT/ TM-T88V-i/ TM-T88V

* Only for South Asia model

58 mm 80 mm

Resolution 180 dpi x 180 dpi (W x H)

Print Width 360 dots 512 dots

Characters in a Line Font A ANK: 30 characters ANK: 42 characters

Font B ANK: 40 characters ANK: 56 characters

Special font
30 characters 42 characters
A*

Special font
40 characters 56 characters
B*

Character Size Font A ANK: 12 dots x 24 dots (W x H)

Font B ANK: 9 dots x 17 dots (W x H)

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

Font B At the 16th 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*

Default Line Feed Space 30 dots

Color Specification First color

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)

Raster Image <image> Monochrome image, Gray scale image

Logo <logo> Monochrome image, Gray scale image

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 (Composite Symbology not supported)

131
* Only for South Asia model

58 mm 80 mm

Ruled Line <hline>, Not supported


<vline-begin>, <vline-end>

Page Mode Line <line> Not supported

Rectangle
<rectangle>

Paper Cut <cut> Cut, Feed cut

Drawer Kick-Out <pulse> Supported

Buzzer <sound> Supported

Paper Layout Settings <layout> Not supported

Command <command> Supported

ePOS-Print Setting (TM-T88V)

Item Value

Printing Method Thermal (180 dpi)

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

Resolution 180 dpi x 180 dpi (W x H)

Print Width 360 dots 384 dots 512 dots

Characters in a Line Font A ANK: 30 characters, ANK: 32 characters ANK: 42 characters

Font B ANK: 40 characters ANK: 42 characters ANK: 56 characters

Font C ANK: 52 characters ANK: 54 characters ANK: 72 characters

Character Size Font A ANK: 12 dots x 24 dots (W x H)

Font B ANK: 9 dots x 17 dots (W x H)

Font C ANK: 8 dots x 16 dots (W x H)

Character Baseline Font A At the 21st dot from the top of the character

Font B At the 16th dot from the top of the character

Font C At the 15th dot from the top of the character

Default Line Feed Space 30 dots

Color Specification First color


Second color, Second color (when two-color printing is set)

Page Mode Default Area 360 dots x 831 dots


(W x H)
384 dots x 831 dots
(W x H)
512 dots x 831 dots
(W x H) 4
when two- 360 dots x 415 dots 384 dots x 415 dots 512 dots x 415 dots
color (W x H) (W x H) (W x H)
printing is
set

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

Raster Image <image> Monochrome image, Two color image

Logo <logo> Monochrome image, Two color image


(To perform two-color printing, change the settings of the printer
using the memory switch setting utility.)

Barcode <barcode> UPC-A, UPC-E, EAN13, JAN13, EAN8, JAN8, CODE39, ITF,
CODABAR, CODE93, CODE128

2D-Code <symbol> PDF417

133
58 mm 60 mm 80 mm

Ruled Line <hline>, Not supported


<vline-begin>, <vline-end>

Page Mode Line <line> Not supported

Rectangle
<rectangle>

Paper Cut <cut> Cut, Feed cut

Drawer Kick-Out <pulse> Supported

Buzzer <sound> Not supported

Paper Layout Settings <layout> Not supported

Command <command> Supported

ePOS-Print Setting

Item Value

Printing Method Thermal (180 dpi)

Character Code Tables Page 0-5, 16-19

134
Chapter 4 XML Reference

TM-U220-i/ TM-U220

76 mm 70 mm 58 mm

Resolution 80 dpi x 72 dpi (W x H)

Print Width 200 dots 180 dots 150 dots

Characters in a Line Font A ANK: 33 characters, ANK: 30 characters ANK: 25 characters

Font B ANK: 40 characters ANK: 36 characters ANK: 30 characters

Character Size Font A ANK: 4.5 dots x 9 dots (W x H)

Font B ANK: 3.5 dots x 9 dots (W x H)

Character Baseline Font A Bottom of the characters

Font B Bottom of the characters

Default Line Feed Space 12 dots

Color Specification First color


First color, Second color (When using a two-color ribbon cassette )

Page Mode Default Area Not supported

Page Mode Maximum Area Not supported

Raster Image <image> Monochrome image

Logo <logo>

Barcode <barcode>
Not supported

Not supported
4
2D-Code <symbol> Not supported

Ruled Line <hline>, Not supported


<vline-begin>, <vline-end>

Page Mode Line <line> Not supported

Rectangle
<rectangle>

Paper Cut <cut> Cut, Feed cut

Drawer Kick-Out <pulse> Supported

Buzzer <sound> Not supported

Paper Layout Settings <layout> Not supported

Command <command> Supported

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.

ePOS-Print Editor Operating Environment


❏ Web Browser
 Windows Internet Explorer 9 or later
 Mozilla Firefox 13 or later
 Google Chrome 19 or later
 Apple Safari 5.1.7 or later
 iPad Safari in iOS 5.1 or later

Environment Setting Procedure

• In Google Chrome, when a preview image including pictures is displayed, a "SECURITY_ERR:


DOM Exception 18" error occurs.
• In Windows Internet Explorer 9, when printing is performed, a "SCRIPT5: Access is denied."
error occurs.

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.

2 Open the following URL page using the Web browser.


http://[Web server IP address]/editor/index.html

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.

Menu area Edit area

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

Create XML data as follows:

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.

2 Configure the added element.


Example: When the NV logo is added, set the key code.

3 Select the [Preview] tab to check the preview image.


When a printer is connected, you can also check the image by printing.
For details, refer to Print (p.143).

• 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.

Perform printing as follows:

1 Select the [Print] tab.

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)".

3 The print document is printed to ePOS-Print supported TM printer. 


The acquired status is displayed in the Information box.

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.

ePOS-Print Editor can import an ePOS-Print XML print document as follows:

1 Select the [Edit] tab and click the [Import] button.

2 The "Import" screen appears. Paste the ePOS-Print XML print document in the
[Data to be import (ePOS-Print XML)] box.

3 Click the [Apply] button.

4 The "Confirmation" screen appears. Click the [Yes] button.

144
Appendix

Encoding Graphic Data


Use ePOS-Print Editor to convert raster graphic bit-image data into a base 64 encoded character string.

How to Use ePOS-Print Editor


Create data as follows:

1 Store the image file you want to print into the same level as the index of this tool.

2 Start ePOS-Print Editor.

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.

7 Code converted into a base 64 encoded character string is displayed in [ePOS-


Print XML Print Document]. Copy the desired character string for use.

146

You might also like