1.0.4 • Published 1 year ago

react-native-suno-usb-printer v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

react-native-suno-usb-printer

React Native Suno USB Printer

Installation

npm install react-native-suno-usb-printer

Usage

import { UsbPrinter } from 'react-native-suno-usb-printer';

// ...
const productId = 8214;
const venderId = 8137;
const filePath = 'sunoprintUsb.pdf';
const isOpenDrawer = false;
const print = async () => {
  try {
    const usbPrinter = new UsbPrinter();
    await usbPrinter.connectDevice(venderId, productId);
    await usbPrinter.addBitmapCommand(filePath, 320, 500);
    await usbPrinter.printCommand(isOpenDrawer);
  } catch (e) {
    console.log('print =>', e);
  }
};
const getList = async () => {
  try {
    const usbPrinter = new UsbPrinter();
    await usbPrinter.init();
    const list = await usbPrinter.getDeviceList();
    console.log(list);
  } catch (e) {
    console.log('getList =>', e);
  }
};

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago