List of ePOS SDK API

ePOS SDK for JavaScript provides the following objects:

Note:

ePOSDevice object


Connects the application and printer.

API

Description

Initialization

Constructor

Initializes the ePOSDevice object.

Communication path

connect method

Establishes the communication path.

disconnect method

Disconnects the communication path.

isConnected method

Acquires the establishment state of the communication path.

Device

createDevice method

Acquires a device objects.

deleteDevice method

Discards a device objects.

Administration information

getAdmin method

Acquires the administration information.

getLocation method

Acquires the installation location information.

OFSC

sendOfscXml method

Sends XML data for OFSC-Print.

Inter-application communication

getCommBoxManager method

Acquires the CommBoxManager object.

Starts reconnection.

onreconnecting event

Reconnection process start event

Completes reconnection.

onreconnect event

Reconnection completion event

Disconnection

ondisconnect event

Network disconnection event

Common to device objects


Controls peripheral devices using the device control scripts that you create.

API

Description

Event call

callEvent method

Calls an event from the corresponding device control script (the SimpleSerial object is not supported).

OtherPeripheral object


Controls peripheral devices using the device control programs that you create.

API

Description

Send

send method

Sends a control command.

Reception of result

onreceive event

Control result reception event

Display object


Controls character display on the customer display.

API

Description

Window

createWindow method

Defines the display area.

destroyWindow method

Deletes the display area setting.

setCurrentWindow method

Switches between display areas.

clearWindow method

Deletes the current display area.

addCreateScreen method

Defines the base window.

addCreateScreenCustom method

Defines the base window.

createTextArea method

Defines the display area.

destroyTextArea method

Deletes the display area setting.

setCurrentTextArea method

Switches between display areas.

Window

clearTextArea method

Deletes the current display area.

Cursor

setCursorPosition method

Moves the cursor.

moveCursorPosition method

Moves the cursor within the display area.

setCursorType method

Changes the cursor display.

Text display

addText method

Displays text.

addReverseText method

Displays inverted text.

addMarquee method

Displays a marquee.

Display attributes

setBlink method

Blinks display.

setBrightness method

Changes the display brightness.

addBackgroundColor method

Sets the background color.

Graphics

addStartSlideShow method

Starts a slide show.

addStopSlideShow method

Ends a slide show.

addDownloadImage method

Displays an image.

addRegisterDownloadImage method

Registers an image.

addNVImage method

Displays an NV image.

addClearImage method

Deletes an image.

Barcode

addSymbol method

Displays a two-dimensional symbol.

addClearSymbol method

Deletes a two-dimensional symbol.

Clock

showClock method

Displays the clock.

Command transfer

addCommand method

Runs an optional command.

Transmission

send method

Sends a control command.

Initialization

reset method

Reset

Reception of result

onreceive event

Control result reception event

The APIs and parameters that can be used vary depending on the customer display used and its display modes.

The table below shows the API that can be used in each customer display and display mode.

API

Parameter

DM-D30

DM-D70

(Standard mode)

DM-D70

(Column/row fixed mode)

DM-D110/
DM-D210

createWindow method

-

destroyWindow method

-

setCurrentWindow method

-

clearWindow method

-

addCreateScreen method

-

-

addCreateScreenCustom method

-

-

createTextArea method

-

-

-

destroyTextArea method

-

-

-

setCurrentTextArea method

-

-

-

clearTextArea method

-

-

-

setCursorPosition method

moveCursorPosition method

setCursorType method

-

-

addText method

data

lang

✔*

✔*

x

y

r

-

-

-

g

-

-

-

b

-

-

-

addReverseText method

-

-

addMarquee method

setBlink method

-

-

setBrightness method

addBackgroundColor method

-

-

-

addStartSlideShow method

-

-

-

addStopSlideShow method

-

-

-

addDownloadImage method

-

-

-

addRegisterDownloadImage method

-

-

-

addNVImage method

-

-

-

addClearImage method

-

-

-

addSymbol method

-

-

-

addClearSymbol method

-

-

-

showClock method

-

-

-

addCommand method

send method

reset method

onreceive event

*: The setting value "mul" cannot be used.

Keyboard object


Controls character entry from the keyboard.

API

Description

String setting

setPrefix method

Sets the condition to handle as a continuous string.

Key detection

onkeypress event

Key press detection event

String detection

onstring event

String detection event

Key code setting

setMSRPrefix method

Sets the condition to control such as MSR data.

Data detection

ondata event

Card information reception event

POSKeyboard object


Controls character entry from POS keyboards.

API

Description

Key detection

onkeypress event

Key press detection event

MSR object


Controls card reading by MSR.

API

Description

Data detection

ondata event

Card data detection event

Printer object


Controls printing by the printer.

API

Description

Text

addTextAlign method

Adds text alignment setting to the command buffer.

addTextLineSpace method

Adds line spacing setting to the command buffer.

addTextRotate method

Adds text rotation setting to the command buffer.

addText method

Adds text to print to the command buffer.

addTextLang method

Adds language setting to the command buffer.

addTextFont method

Adds character font setting to the command buffer.

addTextSmooth method

Adds character smoothing setting to the command buffer.

addTextDouble method

Adds character doubling setting to the command buffer.

addTextSize method

Adds character scaling factor setting to the command buffer.

addTextStyle method

Adds character style setting to the command buffer.

addTextPosition method

Adds character print position setting to the command buffer.

addTextVPosition method

Adds vertical character print start position setting to the command buffer.

Paper feed

addFeedUnit method

Adds paper-feed setting in dots to the command buffer.

addFeedLine method

Adds paper-feed setting in lines to the command buffer.

addFeedPosition method

Adds receipt and label sheet control setting to the command buffer.

addFeed method

Adds line spacing to the command buffer.

Graphics

addImage method

Adds a raster image print command to the command buffer.

addLogo method

Adds a NV logo print command to the command buffer.

Barcode

addBarcode method

Adds a barcode print command to the command buffer.

addSymbol method

Adds a 2D symbol print command to the command buffer.

Ruled line

addHLine method

Adds a horizontal ruled line print command to the command buffer.

addVLineBegin method

Adds a vertical ruled line start command to the command buffer.

addVLineEnd method

Adds a vertical ruled line end command to the command buffer.

Page mode

addPageBegin method

Adds a page mode start command to the command buffer.

addPageEnd method

Adds a page mode end command to the command buffer.

addPageArea method

Adds page mode print area setting to the command buffer.

addPageDirection method

Adds page mode print direction setting to the command buffer.

addPagePosition method

Adds page mode print position setting to the command buffer.

addPageLine method

Adds a page mode line draw command to the command buffer.

addPageRectangle method

Adds a page mode rectangle draw command to the command buffer.

Batch rotate print

addRotateBegin method

Adds the start batch rotate print mode to the command buffer.

addRotateEnd method

Adds the end batch rotate print mode to the command buffer.

Cut

addCut method

Adds a sheet cut command to the command buffer.

Drawer

addPulse method

Adds a drawer kick command to the command buffer.

Buzzer

addSound method

Adds a buzzer sound command to the command buffer.

Layout

addLayout method

Adds sheet layout setting to the command buffer.

Recovery

recover method

Recovers from a recoverable error.

addRecovery method

Adds an error recovery tag.

Reset

reset method

Resets the printer.

addReset method

Adds a printer reset tag.

Command transfer

addCommand method

Adds a command to the command buffer.

Transmission

send method

  • Sends a print document.
  • Send data by specifying the job ID.

print method

  • Prints the HTML5 Canvas.
  • Prints data by specifying the job ID.

Print job

getPrintJobStatus method

Acquires the print job status.

Status monitor

startMonitor method

Enables the status event.

stopMonitor method

Disables the status event.

Image

halftone property

Halftone processing method for raster images.

brightness property

Brightness compensation value for raster images.

Forced transmission

force property

Forced transmission mode

Timeout

timeout property

Transmission timeout period

Monitor interval

interval property

Printer status update interval

Drawer open

drawerOpenLevel property

Drawer signal line status

Command buffer

message property

Direct manipulation of command buffer

Reception of result

onreceive event

  • Response document reception event
  • Job ID specification reception event

onstatuschange event

Status change event

onbatterystatuschange event

Battery status change event

ononline event

Online event

onoffline event

Offline event

onpoweroff event

No response event

oncoverok event

Cover close event

oncoveropen event

Cover open event

onpaperok event

Paper remaining event

onpaperend event

Paper end event

onpapernearend event

Paper almost running out event

ondrawerclosed event

Drawer close event

ondraweropen event

Drawer open event

onbatteryok event

Battery remaining event

onbatterylow event

Battery running out event

The print mode includes the standard mode, page mode, and the batch rotate print mode.

  • Standard mode
  • Prints line by line. Line spacing is automatically adjusted according to character size, image size, and barcode height. Suitable for printing receipts whose print length varies by print content.

  • Page mode
  • Prints page by page. Prints characters, images, and/or barcodes on a single page that is defined as a print area.

    When processing in the page mode, use addPageBegin method to start and addPageEnd method to end the page mode process, respectively.

  • Batch rotate print mode
  • This is a print mode in which the range of the print data (such as characters, images, barcodes, etc.) is set, the print data in the set range is compiled, inverted, and then printed.

    When performing the processing in the batch rotate print mode, start the batch rotate print processing with addRotateBegin method, and end the batch rotate print processing with addRotateEnd method.

The APIs that can be used in each mode are described in the table below.

API

Standard mode

Page mode

Batch rotate
print mode

addTextAlign method

-

addTextLineSpace method

addTextRotate method

-

addText method

addTextLang method

addTextFont method

addTextSmooth method

addTextDouble method

addTextSize method

addTextStyle method

addTextPosition method

addTextVPosition method

-

addFeedUnit method

addFeedLine method

addFeedPosition method

-

addFeed method

addImage method

addLogo method

addBarcode method

addSymbol method

addHLine method

-

addVLineBegin method

-

addVLineEnd method

-

addPageBegin method

-

-

addPageEnd method

-

-

addPageArea method

-

-

addPageDirection method

-

-

addPagePosition method

-

-

addPageLine method

-

-

addPageRectangle method

-

-

addRotateBegin method

-

-

addRotateEnd method

-

-

addCut method

-

-

addPulse method

-

-

addSound method

-

-

addLayout method

-

recover method

-

-

addRecovery method

-

-

reset method

-

-

addReset method

-

-

addCommand method

send method

-

print method

-

getPrintJobStatus method

startMonitor method

stopMonitor method

HybridPrinter2 object


Controls the hybrid printers.

API

Description

Device lock

lock method

Locks the device port.

unlock method

Unlocks the device port.

Print method

selectPaperType method

Sets the print method.

Paper feed

waitInsertion method

Waits for paper insertion.

cancelInsertion method

Cancels the paper insertion wait status.

Paper eject

ejectPaper method

Ejects the paper.

Data transmission

sendData method

Sends a print command.

Print

print method

Prints the HTML5 Canvas.

MICR

readMicrData method

Reads by MICR.

cleanMicrReader method

Cleans the MICR mechanism.

Recovery

recover method

Recovers from a recoverable error.

Reset

reset method

Resets the printer.

Status monitor

startMonitor method

Enables the status event.

stopMonitor method

Disables the status event.

Command buffer

setMessage method

Direct manipulation of command buffer

getMessage method

Direct acquisition of command buffer

Image

halftone property

Halftone processing method for raster images

brightness property

Brightness compensation value for raster images

Forced transmission

force property

Forced transmission mode

Print method acquisition

paperType property

Acquires the print method setting.

Monitor interval

interval property

Printer status update interval

Wait time

waitTime property

Time from insertion of a paper to start of operation

40cpl mode

enable40cplMode property

Enables the 40cpl mode.

Drawer open

drawerOpenLevel property *

Drawer open level

Reception of result

onreceive event

Response document reception event

onstatuschange event *

Status change event

ononline event *

Online event

onoffline event *

Offline event

onpoweroff event *

No response event

oncoverok event *

Cover close event

oncoveropen event *

Cover open event

onpaperok event *

Paper remaining event

onpaperend event *

Paper end event

onpapernearend event *

Paper almost running out event

ondrawerclosed event *

Drawer close event

ondraweropen event *

Drawer open event

* Event common to Printer object.

List of control operations supported for HybridPrinter2 object

APIs available for the HybridPrinter2 object depend on the type of control operation.

The following lists control operation types and available APIs.

API

Control operation

Receipt

Slip

Endorsement

Validation

MICR

lock method

unlock method

selectPaperType method

-

waitInsertion method

-

-

cancelInsertion method

-

ejectPaper method

-

sendData method

-

print method

-

readMicrData method

-

-

-

-

cleanMicrReader method

-

-

-

-

recover method

reset method

startMonitor method

stopMonitor method

setMessage method

-

getMessage method

-

halftone property

-

brightness property

-

force property

-

paperType property

-

interval property

waitTime property

-

enable40cplMode property

-

-

-

-

onreceive event

Creating print document by the HybridPrinter2 object

The HybridPrinter2 object creates a print document using the same APIs as Printer object.

The APIs and corresponding print methods are listed below.

API

Print method

Receipt

Slip

Endorsement

Endorsement (40cpl)

Validation

Text

addTextAlign method

-

addTextLineSpace method

-

addTextRotate method

addText method

addTextLang method

-

-

addTextFont method

-

addTextSmooth method

-

-

-

-

addTextDouble method

-

addTextSize method

-

addTextStyle method

*

*

-

*

addTextPosition method

addTextVPosition method

-

-

-

Paper feed

addFeedUnit method

addFeedLine method

addFeed method

Graphics

addImage method

-

-

-

-

addLogo method

-

-

-

-

Barcode

addBarcode method

-

-

-

-

addSymbol method

-

-

-

-

Page mode

addPageBegin method

-

-

addPageEnd method

-

-

addPageArea method

-

-

addPageDirection method

-

-

addPagePosition method

-

-

addPageLine method

-

-

-

addPageRectangle method

-

-

-

Cut

addCut method

-

-

-

-

Drawer

addPulse method

Command

addCommand method

* The reverse parameter is not supported.

Scanner object


Controls barcode reading by barcode scanner.

API

Description

Data detection

ondata event

Barcode data detection event

SimpleSerial object


Controls printer and serial communication of the device.

API

Description

String setting

sendCommand

Transfers a optional command.

Detects acknowledgment.

oncommandreply event

Optional command transfer result notification event

GermanyFiscalElement object


Connects to the German fiscal element (TSE), and controls data read/write operations.

API

Description

Operation

operate method

Send the JSONString to the German fiscal element (TSE).

Reception of result

ongfereceive event

Control result reception event.

DeviceHubTerminal object


Controls the TM-DT series.

API

Description

Shutdown

shutdown method

Shuts down the printer.

Restart

restart method

Restarts the printer.

CommBoxManager object


Controls opening/closing of the communication box.

API

Description

Inter-application communication

openCommBox method

Opens the communication box.

closeCommBox method

Closes the communication box.

CommBox object


Controls data transmission and reception between the communication box and an application.

API

Description

Transmission history

getCommHistory method

Acquires the data transmission history.

Transmission

send method

Sends data to the communication box.

Reception

onreceive event

Notifies of data reception in the communication box.

ePOSDeviceConfiguration object


Acquires the device information registered to the printer.

API

Description

Constructor

Constructor

Creates an ePOSDeviceConfiguration object.

Status acquisition

getRegisterdDevices method

Acquires device availability status.

 

Quick Access

  • [Name]
  • [Format]
  • [Range]
  • [Description]
  • [Notes]

Epson ePOS SDK includes patented or patent pending functions. The contents must not be disclosed to third parties.


Epson ePOS SDK for JavaScript

Jump to the top