@tumihub/react-native-thermal-print
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

@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

/@tumihub/react-native-thermal-print/

    Package Sidebar

    Install

    npm i @tumihub/react-native-thermal-print

    Weekly Downloads

    6

    Version

    0.2.0

    License

    MIT

    Unpacked Size

    392 kB

    Total Files

    96

    Last publish

    Collaborators

    • tumihub