@tumihub/react-native-thermal-print
v0.2.0
Published
impresión térmica
Downloads
31
Readme
@tumihub/react-native-thermal-print
impresion termica
Installation
yarn add @tumihub/react-native-thermal-print
Usage
import ThermalPrint from '@tumihub/react-native-thermal-print';
// ... Impresión con Bluetooth ...
const configs = {
printerWidthMM: 58,
printerNbrCharactersPerLine: 32,
printerDpi: 180,
};
const image = `[C]<img>${pathFile}</img>\n`;
const qr = `[C]<qrcode size='20'>http://www.developpeur-web.dantsu.com/</qrcode>\n`;
const payload = `${image}${desingText}${qr}`;
ThermalPrint.printBluetooth(mac, payload, configs).progress(({ progress }) => {
console.log('progress', progress);
});
import ThermalPrint from '@tumihub/react-native-thermal-print';
// ... Impresión con Red(TCP) ...
const configs = {
printerWidthMM: 80,
printerNbrCharactersPerLine: 48,
printerDpi: 200,
};
const image = `[C]<img>${pathFile}</img>\n`;
const qr = `[C]<qrcode size='20'>valueQrCode</qrcode>\n`;
const payload = `${image}${desingText}${qr}`;
ThermalPrinter.printTcp(ipAddress, 9100, payload, configs).progress(
(progress) => {
console.log('progress', progress);
}
);
import ThermalPrint from '@tumihub/react-native-thermal-print';
// ... Obtener impresoras Bluetooth ...
const [devices, setDevices] = useState([]);
useEffect(() => {
ThermalPrinter.getDevicesBluetooth().then((val) => {
setDevices(val);
});
}, []);
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT