1.0.0 • Published 6 years ago

react-native-honeywell-rp4a v1.0.0

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

react-native-honeywell-printer-RP4A

react-native link react-native-bluetooth-serial

Online ZPL Viewer http://labelary.com/viewer.html

Installation

  1. Install package via npm: npm i -S react-native-honeywell-printer-RP4A

  2. Link libraries with: rnpm link or react-native link for React Native >= 0.27

Commands:

  • broad: X axis position relative to page
  • height: Y axis position relative to page
  • positionX: Position relative to the X axis
  • positionY: Position relative to the Y axis
  • code: ZPL code
  • size: size the text
  • word: word, text

  • 1 through 5 generates ZPL codes

  1. printer.barCode( positionX, positionY, code);
  • generate barcode ZPL code
  1. printer.text(broad, heigth, word, size);
  • generate text ZPL code
  1. printer.qrCode( positionX, positionY, code);
  • generate qrCode ZPL code
  1. printer.addCode(codeZPL)
  • addCode
  1. console.log(printer.showCode())
  • show the genereated ZPL code

  • connect with bluetooth

  1. printer.bluetoothShow() .then( (res) => console.log(printer.printerCode(res)) // send code for printer ) .catch((err) => console.log(err.message));

  2. printer.deleteCode();

Example:

import printer from 'react-native-honeywell-printer-rp4a';

  printer.barCode( 10, 12, 70);

  printer.text(500, 500, "word", 50);

  printer.qrCode(300, 400, "word");

  printer.addCode(
    `^FO50,50^GB100,100,100^FS
  ^FO75,75^FR^GB100,100,100^FS
  ^FO88,88^GB50,50,50^FS` 
  )

  console.log(printer.showCode())

  printer.bluetoothShow()
    .then((res) =>
      console.log(printer.printerCode(res))
      )
    .catch((err) =>
      console.log(err.message)
      ); 
1.0.0

6 years ago