0.0.14 • Published 4 years ago

react-native-epson-epos-printer v0.0.14

Weekly downloads
6
License
MIT
Repository
-
Last release
4 years ago

react-native-epson-epos-printer

React native module to handle Epson ePOS SDK (for now, only Android)

npm version MIT License npm downloads install size npm version

🚀 Installation

Using npm:

npm i react-native-epson-epos-printer

đź“– Documentation

Tags:

The printing order is sequential and will go according to the payload.

Implementation

import Printer from 'react-native-epson-epos-printer';
Printer.print(1, '50:57:9C:57:7B:M1', examplePayload)
                .then(console.log)
                .catch(console.log)

đź“‹ Commands

KeyTypeDescription
imageurllink to download the image. Alternatively, the size tag can be used to indicate the size of the image, by default the size is 187
linenumberspecifies the number of lines to skip. You can also use the text tag with new lines.
dottednumberspecifies the number of centered dotted lines. You can also use the centered tag with "------------------------------".
centeredstringcentered text.
textstringdefault text positioned to the left and add new line at the end. You can write a paragraph making line breaks with \n to avoid having to add several text tags.
leftstringwrite the text to the left without adding a new line. Using new lines can cause unexpected problems, to use a new line better use the text tag.
rightstringwrite the text to the right without adding a new line. left and right can be used in combination, when combined a new line will be added by default. Example:{ "left": "Celggar:", "right": "$33,024.01"}.
barcodestringprint a barcode. default (BARCODE_CODE93). Barcode Types

đź“‹ Barcode types

BarcodeValue
BARCODE_UPC_A0
BARCODE_UPC_E1
BARCODE_EAN132
BARCODE_JAN133
BARCODE_EAN84
BARCODE_JAN85
BARCODE_CODE396
BARCODE_ITF7
BARCODE_CODABAR8
BARCODE_CODE939
BARCODE_CODE12810
BARCODE_GS1_12811
BARCODE_GS1_DATABAR_OMNIDIRECTIONAL12
BARCODE_GS1_DATABAR_TRUNCATED13
BARCODE_GS1_DATABAR_LIMITED14
BARCODE_GS1_DATABAR_EXPANDED15

đź’» Example Payload

[
  {
    "image": "https://github.githubassets.com/images/modules/logos_page/Octocat.png"
  },
  {
    "line": 1
  },
  {
    "centered": "Celggar Company"
  },
  {
    "centered": "RUC 777-136-113133  DV  02"
  },
  {
    "centered": "CapellanĂ­a"
  },
  {
    "centered": "Express line 236-5555"
  },
  {
    "line": 2
  },
  {
    "text": "RUC/CIP: C-8-330124"
  },
  {
    "text": "SOCIAL: TODD MULLINS - 8733212"
  },
  {
    "line": 2
  },
  {
    "text": "INVOICE: 0-00000002401\nDOCUMENTO ERP: ACM1PT\nSUCURSAL: CapellanĂ­a - Principal\nSELLER: Celggar WEB\n NAME: Celggar"
  },
  {
    "line": 3
  },
  {
    "centered": "FECHA: 11/09/2020    HORA: 8:47"
  },
  {
    "barcode": "0-0000039242",
    "type": 9
  },
  {
    "text": "COMMAND"
  },
  {
    "dotted": 2
  },
  {
    "text": "2.0 x $4.99"
  },
  {
    "text": "C000056297 Abono orgánico humus 40lb $9.98 1.0 x 10.99"
  },
  {
    "text": "C000056298 Rodillo para pintar $9.98 1.0 x 10.99"
  },
  {
    "text": "C000056299 Leche 40lb $9.98 1.0 x 10.99"
  },
  {
    "text": "C000007394 COSTO DE ENVĂŤO (ACARREO) $7.95"
  },
  {
    "left": "SUBTOTAL:",
    "right": "$109.10"
  },
  {
    "left": "DISCOUNT:",
    "right": "$0.0"
  },
  {
    "dotted": 1
  },
  {
    "left": "SUBTOTAL (again):",
    "right": "$109.10"
  },
  {
    "left": "EXEMPT:",
    "right": "$0.00"
  },
  {
    "left": "GRAVABLE:",
    "right": "$109.10"
  },
  {
    "left": "I.T.B.M.S (7%):",
    "right": "$5.38"
  },
  {
    "left": "TOTAL:",
    "right": "$114.48"
  },
  {
    "left": "PUNTOS C:",
    "right": "$7.83"
  },
  {
    "left": "CAMBIO:",
    "right": "$0"
  },
  {
    "dotted": 2
  },
  {
    "text": "DELIVERY ADDRESS"
  },
  {
    "dotted": 1
  },
  {
    "text": "Panamá, Coclé, Capellanía, Lex Luthor Tower, Apto ACM1PT 01A Calle Justice League - cerca de la cueva de Batman"
  },
  {
    "text": "COMMENTS: NO COMMENTS"
  },
  {
    "text": "EMAIL: lobezno33@jleague.com"
  },
  {
    "text": "PHONE: 236-5555"
  }
]
0.0.14

4 years ago

0.0.13

4 years ago

0.0.12

4 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.3

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.6

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago