0.0.21 • Published 7 months ago

capacitor-plugin-epson-epos v0.0.21

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

capacitor-plugin-epson-epos

A capacitorjs plugin for Epson Pos Printer

Android

  • ePos SDK: V2.29.0.a
  • Only tested with TM_T20III Ethernet / TM_T20 USB

Roadmap

  • Add iOS support

Install

npm install capacitor-plugin-epson-epos
npx cap sync

How to use

API

requestPermission()

requestPermission() => Promise<{ success: boolean; }>

Returns: Promise<{ success: boolean; }>


startDiscovery(...)

startDiscovery(options: DiscoveryOptions) => Promise<DiscoveryResult>
ParamType
optionsDiscoveryOptions

Returns: Promise<DiscoveryResult>


stopDiscovery()

stopDiscovery() => Promise<{ message: string; }>

Returns: Promise<{ message: string; }>


print(...)

print(options: PrintOptions) => Promise<{ success: boolean; }>
ParamType
optionsPrintOptions

Returns: Promise<{ success: boolean; }>


finalizePrinter()

finalizePrinter() => Promise<{ message: string; }>

Returns: Promise<{ message: string; }>


Interfaces

DiscoveryResult

PropType
printersDiscoveryResultPrinter[]

DiscoveryResultPrinter

PropType
PrinterNamestring
Targetstring

DiscoveryOptions

PropTypeDefault
timeoutnumber10000 (milliseconds)
broadcaststring'255.255.255.255'
portTypeEpsonEposPortType'ALL'

PrintOptions

PropTypeDefault
targetstring
instructionsPrintInstruction[]
modelCodeEpsonEposPrinterSerie
langCodestring'ANK'

PrintInstruction

PropTypeDescription
addHPositionnumberInteger from 0 to 65535
addLineSpacenumberInteger from 0 to 255
addFeedLinenumberInteger from 0 to 255
addFeedUnitnumberInteger from 0 to 255
addTextAlignTextAlign
addTextPrintText
addTextStylePrintTextStyle
addBase64ImagePrintBase64Image
addBarcodePrintBarcode
addSymbolPrintSymbol
addTextSizenumber, number
addHLinePrintHorizontalLine
addVLineBeginPrintVerticalLine
addVLineEndPick<PrintVerticalLine, 'lineId'>
addCutCut
addPulsePrintWithPulse
addCommandBinaryType
addFeedPositionFeedPosition
addLayoutPrintLayout

PrintText

PropType
valuestring | string[]
sizenumber, number
alignTextAlign
stylePrintTextStyle

PrintTextStyle

PropTypeDefault
reversebooleanfalse
ulbooleanfalse
embooleanfalse

PrintBase64Image

PropTypeDescriptionDefault
valuestringBase64 image string
xnumber
ynumber
widthnumberSpecifies the width of the print area (in pixels).
heightnumberSpecifies the height of the print area (in pixels).
colorImageColorSpecifies the color.COLOR_1
modeImageModeSpecifies the mode.MONO
compressImageHalfToneEnables or disables compression. Compressing print images can prevent white banding or streaks from occurring on printed images. This works well when connecting with the printer using Bluetooth.AUTO
halftoneImageHalfToneSpecifies the halftone
brightnessnumberSpecifies the brightness compensation value.1

PrintBarcode

PropTypeDefault
valuestring
typeBarcodeTypeCODE_39
fontBarcodeFontFONT_A
hriBarcodeHriHRI_BELOW
widthnumber2 Integer from 2 to 6
heightnumber100 Integer from 1 to 255

PrintSymbol

PropTypeDescriptionDefault
valuestring
typeSymbolType
levelnumber | SymbolLevelPDF | SymbolLevelQRCode
widthnumberThe range differs depending on the 2D symbol type.PDF417 from 2 to 8
heightnumberThe range differs depending on the 2D symbol type.PDF417 from 2 to 8
sizenumberThe range differs depending on the 2D symbol type.PDF417 0

PrintHorizontalLine

PropType
positionnumber, number
lineStyleLineStyle

PrintVerticalLine

PropType
positionnumber
lineStyleLineStyle
lineIdnumber[]

PrintWithPulse

PropTypeDefault
drawerDrawerPin2pin
timePulseTime100

PrintLayout

PropType
typeLayoutType
widthnumber
heightnumber
marginTopnumber
marginBottomnumber
offsetCutnumber
offsetLabelnumber

Type Aliases

EpsonEposPortType

'ALL' | 'TCP' | 'BLUETOOTH' | 'USB'

TextAlign

'left' | 'right' | 'center'

ImageColor

'COLOR_1' | 'COLOR_2' | 'COLOR_3' | 'COLOR_4' | 'COLOR_NONE'

ImageMode

'MONO' | 'GRAY16' | 'HIGH_DENSITY'

ImageHalfTone

'DITHER' | 'THRESHOLD' | 'ERROR_DIFFUSION'

BarcodeType

Types representing the allowed barcode types.

'UPC_A' | 'UPC_E' | 'EAN13' | 'JAN13' | 'EAN8' | 'JAN8' | 'ITF' | 'CODA_BAR' | 'CODE_39' | 'CODE_93' | 'CODE_128' | 'CODE_128_AUTO' | 'GS1_128' | 'GS1_DATA_BAR_OMNIDIRECTIONAL' | 'GS1_DATA_BAR_TRUNCATED' | 'GS1_DATA_BAR_LIMITED' | 'GS1_DATA_BAR_EXPANDED'

BarcodeFont

Types representing the allowed barcode fonts.

'FONT_A' | 'FONT_B' | 'FONT_C' | 'FONT_D' | 'FONT_E'

BarcodeHri

Types representing the allowed barcode HRI (Human Readable Interpretation) positions.

'HRI_NONE' | 'HRI_ABOVE' | 'HRI_BELOW' | 'HRI_BOTH'

SymbolType

'PDF417_TRUNCATED' | 'QRCODE_MODEL_1' | 'QRCODE_MODEL_2' | 'QRCODE_MICRO' | 'MAXICODE_MODE_2' | 'MAXICODE_MODE_3' | 'MAXICODE_MODE_4' | 'MAXICODE_MODE_5' | 'MAXICODE_MODE_6' | 'GS1_DATABAR_STACKED' | 'GS1_DATABAR_STACKED_OMNIDIRECTIONAL' | 'GS1_DATABAR_EXPANDED_STACKED' | 'AZTECCODE_FULLRANGE' | 'AZTECCODE_COMPACT' | 'DATAMATRIX_SQUARE' | 'DATAMATRIX_RECTANGLE_8' | 'DATAMATRIX_RECTANGLE_12' | 'DATAMATRIX_RECTANGLE_16'

SymbolLevelPDF

'LEVEL_0' | 'LEVEL_1' | 'LEVEL_2' | 'LEVEL_3' | 'LEVEL_4' | 'LEVEL_5' | 'LEVEL_6' | 'LEVEL_7' | 'LEVEL_8'

SymbolLevelQRCode

'LEVEL_L' | 'LEVEL_M' | 'LEVEL_Q' | 'LEVEL_H'

SymbolLevelAztecCode

number

LineStyle

'thin' | 'medium' | 'thick' | 'thin_double' | 'medium_double' | 'thick_double'

Pick

From T, pick a set of properties whose keys are in the union K

{ P in K: TP; }

Cut

'cut_feed' | 'cut_no_feed' | 'cut_reserve' | 'full_cut_feed' | 'full_cut_no_feed' | 'full_cut_reserve'

DrawerPin

'2pin' | '5pin'

PulseTime

'pulse_100' | 'pulse_200' | 'pulse_300' | 'pulse_300' | 'pulse_400' | 'pulse_500'

FeedPosition

'peeling' | 'cutting' | 'current_tof' | 'next_tof'

LayoutType

'receipt' | 'receipt_bm' | 'label' | 'label_bm'

EpsonEposPrinterSerie

'TM_M10' | 'TM_M30' | 'TM_P20' | 'TM_P60' | 'TM_P60II' | 'TM_P80' | 'TM_T20' | 'TM_T60' | 'TM_T70' | 'TM_T81' | 'TM_T82' | 'TM_T83' | 'TM_T83III' | 'TM_T88' | 'TM_T90' | 'TM_T90KP' | 'TM_T100' | 'TM_U220' | 'TM_U330' | 'TM_L90' | 'TM_H6000' | 'TM_M30II' | 'TS_100' | 'TM_M50' | 'TM_T88VII' | 'TM_L90LFC' | 'EU_M30' | 'TM_L100' | 'TM_P20II' | 'TM_P80II' | 'TM_M30III' | 'TM_M50II' | 'TM_M55' | 'TM_U220II'

0.0.20

7 months ago

0.0.21

7 months ago

0.0.19

7 months ago

0.0.18

7 months ago

0.0.17

7 months ago

0.0.16

7 months ago

0.0.15

7 months ago

0.0.14

7 months ago

0.0.13

7 months ago

0.0.12

7 months ago

0.0.11

7 months ago

0.0.10

7 months ago

0.0.9

7 months ago

0.0.8

7 months ago

0.0.7

7 months ago

0.0.6

7 months ago

0.0.5

7 months ago

0.0.4

7 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago