React Native Xprinter
Xprinter driver currently only support android, and it's not finished yet.
Installation
Mostly automatic install
$ npm install react-native-xprinter --save$ react-native link
Usage
Get bluetooth devices
First of all you need get the bluetooth device list, and select one to use.
;;RNXprinter; // Select a printer to uselet printerList = await RNXprinter;await RNXprinter; // Or you can use printer pick panelRNXprinter;
Print DEMO
After you connected to your printer, try this to make sure everything except yourself is worked perfectly.
await RNXprinter;
Push things to buffer
Thermal printer is a kind of high speed printer, so we need push all things to the buffer first.
// Push Text// text: string # The string you want to print// size: number # 0 ~ 7 LevelRNXprinter; // Push Image// size: index # The FLASH index of image// Currently only supported without download image, you need use your computer to helpRNXprinter; // Push Cut PaperRNXprinter;
await RNXprinter;
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Roadmap
- Android support
- Save default printer
- Test coverage
- Printer select panel
- Download image to printer
- USB support
Known Issues
History
TODO: Write history
Credits
TODO: Write credits