I would expect print button to ether send the contents of the container to my zebra 2824 or worst case at least generate a PDF I could send to the printer. Any best practises on how to do it?
PS I just stumbled upon a native QR code generator.
direct to Zebra (from chatGPT, never used one before):
// Convert base64 to ZPL (this is a simplified example, you might need more specific encoding)
const base64Image = "your_base64_string_here";
const zpl = `
^XA
^FO50,50^GFA,${base64Image.length},${base64Image.length},${base64Image}
^XZ
`;
// Send ZPL to the printer (Assuming you have an endpoint or mechanism)
fetch('http://your_printer_ip', {
method: 'POST',
headers: {
'Content-Type': 'text/plain'
},
body: zpl
}).then(response => {
console.log('Print command sent.');
}).catch(error => {
console.error('Error sending print command: ', error);
});
Thank you. An interesting idea to try.
However, I would have to try another qrcode generator.
Native generator does not have base64 of the generated code exposed anywhere. Unless I don't know where to look...
How would one get a base64 of an image of a qr code that's natively generated?
Can't see anything like base64 exposed in the status of the qr code module.