Closed Hassan-jr closed 1 year ago
@seokju-na Please respond to this.
Have you tried Web Bluetooth API? If the interface accepts Uint8Array, printing will available. Didn't test but you can try the code below. (or you can use bluetooth module works in Node.js)
import { Printer, Text } from 'react-thermal-printer';
const device = await navigator.bluetooth({ filters: [{ name: 'Printer' }] });
const server = await device.gatt.connect();
const service = await server.getPrimaryService('printer_service');
const characteristic = await service.getCharacteristic('printer_write_characteristic');
const data = await render(
<Printer type="epson">
<Text>Hello World</Text>
</Printer>
);
await characteristic.writeValue(data.buffer);
@seokju-na Thanks for the response... Let me try that.
@Hassan-jr Hi, have you tried the web bluetooth api?
Does this package support printing via Bluetooth and if yes please share an example.