1.0.0 • Published 6 years ago
react-native-honeywell-rp4a v1.0.0
react-native-honeywell-printer-RP4A
react-native link react-native-bluetooth-serial
Online ZPL Viewer http://labelary.com/viewer.html
Installation
Install package via npm:
npm i -S react-native-honeywell-printer-RP4A
Link libraries with:
rnpm link
orreact-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
- printer.barCode( positionX, positionY, code);
- generate barcode ZPL code
- printer.text(broad, heigth, word, size);
- generate text ZPL code
- printer.qrCode( positionX, positionY, code);
- generate qrCode ZPL code
- printer.addCode(codeZPL)
- addCode
- console.log(printer.showCode())
show the genereated ZPL code
connect with bluetooth
printer.bluetoothShow() .then( (res) => console.log(printer.printerCode(res)) // send code for printer ) .catch((err) => console.log(err.message));
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