react-native-suno-usb-printer
v1.0.4
Published
test
Downloads
2
Readme
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