@nextup/react-native-zebra-printer

5.0.2 • Public • Published

React Native Zebra Printer

This package works with Zebra devices that use the Intermec PB50 printer. It may also work on other Intermec printers, but this is not guaranteed.

Note that this is an experimental package.

Tested to work with React Native 0.56 and 0.57. Only works on Android.

Installation

yarn add react-native-zebra-printer

To install the native dependencies:

react-native link react-native-zebra-printer

Unless you already know the Bluetooth MAC address of the printer, you need to use react-native-bluetooth-serial as well. Since it has an issue with recent versions of React Native, we use this fork.

Usage

First you need to copy printerprofiles.json from this repository to android/app/src/main/assets/Omega-300.zpl in your project. You can modify this file to change the styling of the print document.

import BluetoothSerial from 'react-native-bluetooth-serial';
import zebraPrinter from 'react-native-zebra-printer';

async function print() {
    const devices = await BluetoothSerial.list();
    const device = devices.find(device => device.name.includes('PB50'));
    if (device) {
        await zebraPrinter.print(device.id, 'My variable to print');
    }
}

Readme

Keywords

Package Sidebar

Install

npm i @nextup/react-native-zebra-printer

Weekly Downloads

0

Version

5.0.2

License

none

Unpacked Size

18.1 MB

Total Files

1119

Last publish

Collaborators

  • stefanpahlplatz
  • roelvdboom