Features:
- API to create ESC/POS command buffers Docs
- Command chaining Docs
- Print to screen using
VirtualPaper
Docs - Bluetooth connection Docs
Todo:
- Read from Uint8Array buffer to
VirtualPaper
- USB connection
- TCP connection GraphQL
Basic usage
import POS, {
createEscPosEncoder,
} from '@g01-tecnologia/react-native-pos-printer';
const PRINTER_MAC_ADDRESS = '00:00:00:00:00:00'; // Use your printer MAC Address here or get it via the Bluetooth module
// Call once, starts the bluetooth module
await POS.Bluetooth.start();
// Creates instance of the encoder class
const encoder = createEscPosEncoder();
// Uses chaining to queue commands and encodes it to
// single Uint8Array buffer
const commands: Uint8Array = encoder
.initialize()
.bold(true)
.line('Hello, POS!')
.bold(false)
.encode();
// Uses bluetooth api to onnect to an
// already paired printer
await POS.Bluetooth.connect(PRINTER_MAC_ADDRESS);
// Sends ESC/POS commands to it
await POS.Bluetooth.sendCommands(commands);
For full documentation, visit react-native-pos-printer.github.io/docs
To see how to Contribute, visit Getting Started
- Community Forum. Best for: help with building, discussion about database best practices.
- GitHub Issues. Best for: bugs and errors you encounter using Supabase.
- Email Support. Best for: problems with your database or infrastructure.
- Discord. Best for: sharing your applications and hanging out with the community.
- Alpha: Not all basic functionalities are ready yet
- Public Alpha: Anyone can sign up. But go easy on us, there are a few kinks
- Public Beta: Stable enough for most non-enterprise use-cases
- Public: Production-ready
We are currently in Alpha. Watch "releases" of this repo to get notified of major updates.
- Niels Leenheer, creator of the original EscPosEncoder, CanvasDither and CanvasFlatten base!
- All future contributors, I'll try to mantain this project but I'll most certainly fail to do that, so feel free to contribute!