Epson ePOS SDK for JavaScript

    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


    Calls an event from the device control script.

    API

    Description

    Event call

    callEvent method

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

    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.

    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.

    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

    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

    MSR object


    Controls card reading by MSR.

    Note:

    You can customize the operation by creating a device control script. Refer to ePOS SDK for JavaScript User's Manual

    API

    Description

    Data detection

    ondata event

    Card data detection event

    Printer object


    Controls printing by the printer. Two print modes are available; standard and page modes.

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

    API

    Description

    Standard mode

    Page mode

    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.

    -

    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.

    API

    Description

    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

    HybridPrinter object


    Controls printing by the hybrid printer.

    API

    Description

    Standard mode

    Page mode

    Device lock

    lock method

    Locks the device port.

    -

    unlock method

    Unlocks the device port.

    -

    Paper eject

    eject method

    Ejects the check sheet.

    -

    Prints on receipt.

    ReceiptPrinter.send method

    Sends a print document.

    ReceiptPrinter.print method

    Prints the HTML5 Canvas.

    Front side slip printing

    SlipPrinter.send method

    Sends a print document.

    SlipPrinter.cancel method

    Cancels the check sheet insertion wait status.

    Back side slip printing

    EndorsePrinter.enable40cplMode method

    Enables the 40cpl mode.

    -

    EndorsePrinter.send method

    Sends a print document.

    -

    EndorsePrinter.cancel method

    Cancels the check sheet insertion wait status.

    -

    MICR

    MICRReader.read method

    Reads by MICR.

    -

    MICRReader.cleaning method

    Cleans the MICR mechanism.

    -

    MICRReader.cancel method

    Cancels the cleaning sheet insertion wait status.

    -

    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.

    API

    Description

    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

    SlipPrinter.timeout property

    Check sheet insertion wait timeout period

    EndorsePrinter.timeout property

    Check sheet insertion wait timeout period

    MICRReader.timeout property

    Check/cleaning sheet insertion wait timeout period

    Monitor interval

    interval property

    Printer status update interval

    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.

    Creating print document by the HybridPrinter object

    The HybridPrinter object creates a print document using the same method as Printer object.

    The methods and corresponding print methods are listed below.

    API

    Print method

    Receipt

    Slip sheet

    Front side

    Back side

    Back side 40cpl

    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

    -

    addFeedPosition method

    -

    -

    -

    -

    addFeed method

    Graphics

    addImage method

    -

    -

    -

    addLogo method

    -

    -

    Barcode

    addBarcode method

    -

    -

    addSymbol method

    -

    -

    -

    Ruled line

    addHLine method

    -

    -

    -

    -

    addVLineBegin method

    -

    -

    -

    -

    addVLineEnd method

    -

    -

    -

    -

    Page mode

    addPageBegin method

    -

    -

    addPageEnd method

    -

    -

    addPageArea method

    -

    -

    addPageDirection method

    -

    -

    addPagePosition method

    -

    -

    addPageLine method

    -

    -

    -

    -

    addPageRectangle method

    -

    -

    -

    -

    Cut

    addCut method

    -

    -

    -

    Drawer

    addPulse method

    Buzzer

    addSound method

    -

    -

    -

    -

    Layout

    addLayout method

    -

    -

    -

    -

    Command transfer

    addCommand method

    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.

    Note:

    You can customize the operation by creating a device control script. Refer to ePOS SDK for JavaScript User's Manual

    API

    Description

    String setting

    sendCommand

    Transfers a optional command.

    Detects acknowledgment.

    oncommandreply event

    Optional command transfer result notification 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.


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

    Jump to the top