Select your printer model

Parameters are refined by the selected printer.

onreceive event


Receives the print result.

Syntax

 
Function (response)

Parameters of callback function

Parameter: response

Object type: Object

response object properties

Property

Description

Object type

success

Print result

Boolean

code

Error code

String

status

Status

Number

battery

Battery status

Number

printjobid

Print job ID

String

success

Value

Description

true

  • Printing succeeded.
  • Process succeeded (when the spooler function is enabled).

false

  • Printing failed.
  • Process failed (when the spooler function is enabled).

code

Value

Description

'EPTR_AUTOMATICAL'

Automatic recovery error occurred.

'EPTR_BATTERY_LOW'

Battery has run out.

'EPTR_COVER_OPEN'

Cover open error occurred.

'EPTR_CUTTER'

Auto cutter error occurred.

'EPTR_MECHANICAL'

Mechanical error occurred.

'EPTR_REC_EMPTY'

Roll paper has run out.

'EPTR_UNRECOVERABLE'

Unrecoverable error occurred.

'SchemaError'

Print request XML contains a syntax error.

'DeviceNotFound'

Printer specified by the device ID does not exist.

'PrintSystemError'

Error occurred with the printing system.

'EX_BADPORT'

Error was detected with the communication port.

'EX_TIMEOUT'

Print timeout occurred.

'EX_SPOOLER'

Print queue is full.

'JobNotFound'

Specified job ID does not exist.

'Printing'

Printing

'TooManyRequests'

The number of print jobs sent to the printer has exceeded the allowable limit.

'RequestEntityTooLarge'

The size of the print job data exceeds the capacity of the printer.

'JobSpooling'

Job is spooling.

'ERROR_WAIT_EJECT'

Waiting for paper removal

status

Perform an AND operation with a constant.

Constant (status)

Description

ASB_NO_RESPONSE

No response from printer

ASB_PRINT_SUCCESS

Print finished/spool completed

ASB_DRAWER_KICK

Drawer kick connector pin No.3 status = "H"

ASB_BATTERY_OFFLINE

Offline status due to the battery level

ASB_OFF_LINE

Offline status

ASB_COVER_OPEN

Cover open

ASB_PAPER_FEED

Paper is being fed by the paper feed switch.

ASB_PANEL_SWITCH

Panel switch is being operated.

ASB_MECHANICAL_ERR

Mechanical error occurred.

ASB_AUTOCUTTER_ERR

Auto cutter error occurred.

ASB_UNRECOVER_ERR

Unrecoverable error occurred.

ASB_AUTORECOVER_ERR

Automatic recovery error occurred.

ASB_RECEIPT_NEAR_END

Roll paper has almost run out.

ASB_RECEIPT_END

Roll paper has run out.

ASB_BUZZER

Buzzer is sounding (supported model only)

ASB_WAIT_REMOVE_LABEL

Waiting for labels to be peeled.

ASB_NO_LABEL

No labels awaiting peeling.

ASB_SPOOLER_IS_STOPPED

Spooler stopped

battery

  • AC adapter connection status
  • Constant (battery)

    Description

    0x30XX

    Connected

    0x31XX

    Not connected

  • Remaining battery capacity
  • Constant (battery)

    Description

    0xXX36

    Remaining battery capacity 6

    0xXX35

    Remaining battery capacity 5

    0xXX34

    Remaining battery capacity 4

    0xXX33

    Remaining battery capacity 3

    0xXX32

    Remaining battery capacity 2

    0xXX31

    Remaining battery capacity 1 (almost run out)

    0xXX30

    Remaining battery capacity 0 (run out)

printjobid

Value

Description

printjobid

Print job ID

Supplementary explanation

  • For a model without battery, 0xXX30 is set to the battery constant.
  • When there is no print job ID, "" (blank character) is set in printjobid.
  • No onreceive event is notified if a communication error occurs.
    To notify the disconnection event, implement the onreconnecting event, onreconnect event, ondisconnect event.
  • If a communication error occurs and it is deemed that no recovery will take place, notify ondisconnect event.
    Since no onreceive event is notified in this case, detect print failures in ondisconnect event.
 

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