Open iuryol opened 1 year ago
I really wanted that feature too!
Me too.
This fork supports https://github.com/thiendangit/react-native-thermal-receipt-printer-image-qr
when can use this
const printQRCode = async () => { try { const qrData = 'Hello World'; const dataLen = qrData.length + 3; const pL = dataLen % 256; const pH = Math.floor(dataLen / 256);
const commands = [
'\x1D\x28\x6B\x03\x00\x31\x43\x08', // Set QR code size
'\x1D\x28\x6B\x03\x00\x31\x45\x31', // Set QR code error correction level
`\x1D\x28\x6B${String.fromCharCode(pL)}${String.fromCharCode(
pH,
)}\x31\x50\x30${qrData}`,
'\x1D\x28\x6B\x03\x00\x31\x51\x30', // Print QR code
].join('');
await NetPrinter.printText(commands);
console.log(commands);
await NetPrinter.closeConn();
console.log('QR code printed successfully.');
} catch (error) {
console.error('Failed to print QR code:', error);
}
};
Hello , how i can use this library for print a qrcode too , need some help . this one looks great if u guys have some way to print qrcode a i'll be very grateful