Code Monkey home page Code Monkey logo

react-native-honeywell-printer's Introduction

React Native Honeywell Printer

This package works with Honeywell 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-honeywell-printer

To install the native dependencies:

react-native link react-native-honeywell-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/printerprofiles.json in your project. You can modify this file to change the styling of the print document.

import BluetoothSerial from 'react-native-bluetooth-serial';
import honeywellPrinter from 'react-native-honeywell-printer';

async function print() {
    const devices = await BluetoothSerial.list();
    // Search for Intermec PB50 devices; this is the only tested printer at the moment.
    const device = devices.find(device => device.name.includes('PB50'));
    if (device) {
        // This is the profile name defined in android/app/src/main/assets/printerprofiles.json
        const profileName = 'PB32_Fingerprint';
        await honeywellPrinter.print(profileName, device.id, 'My variable to print');
    }
}

TODO

  • There is no progress indication
  • There is no indication whether printing succeeded or failed

We probably won't have time to build this since we'll only have a Intermec printer for a limited time.

react-native-honeywell-printer's People

Contributors

spacek33z avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.