New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-native-escpos-android

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-escpos-android

A library to use escpos on android

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
2
-99.48%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-escpos-android

A library to use escpos on android with using ESCPOS-ThermalPrinter-Android.

Installation

npm install react-native-escpos-android

Usage

Write formatted text. The fromat is supplied by ESCPOS-ThermalPrinter-Android.

import EscposAndroid from "react-native-escpos-android";

var text =
  "[C]================================\n" +
  "[L]\n" +
  "[L]<b>BEAUTIFUL SHIRT</b>[R]9.99e\n" +
  "[L]  + Size : S\n" +
  "[L]\n" +
  "[L]<b>AWESOME HAT</b>[R]24.99e\n" +
  "[L]  + Size : 57/58\n" +
  "[L]\n" +
  "[C]--------------------------------\n" +
  "[R]TOTAL PRICE :[R]34.98e\n" +
  "[R]TAX :[R]4.23e\n" +
  "[L]\n" +
  "[C]================================\n" +
  "[L]\n" +
  "[L]<font size='tall'>Customer :</font>\n" +
  "[L]Raymond DUPONT\n" +
  "[L]5 rue des girafes\n" +
  "[L]31547 PERPETES\n" +
  "[L]Tel : +33801201456\n" +
  "[L]\n" +
  "[C]<barcode type='ean13' height='10'>831254784551</barcode>\n" +
  "[C]<qrcode size='20'>http://www.developpeur-web.dantsu.com/</qrcode>"
await EscposAndroid.write({ text , cut: true });

You can write raw data.

let raw = [
  0x1b, 0x40, // initialize
  0x0a, // change line
  0x0a, // change line
  0x0a, // change line
  0x1c, 0x43, 0x01, // set shift-jis
  0x1b, 0x64, 0x02, // feed
  0x0a, // change line
  // 0x1b, 0x1c, 0x26, // kanji mode
  0x82, 0xA0, 0x82, 0xA2, 0x82, 0xA4, // あいう in shift-jis
  0x0a, // change line
  0x8a, 0xbf, 0x8e, 0x9a, // 漢字 in shift-jis
  0x0a, // change line
  0x1b, 0x64, 0x02, // feed
  0x1D, 0x56, 0x01, // cut
]
await EscposAndroid.write({ raw });

License

MIT

Keywords

react-native

FAQs

Package last updated on 27 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts