Flutter how to print data with zebra thermal printer using bluetooth

Viewed 383

I'm facing a serious problem to print receipt using Bluetooth for sending to thermal printer Zebra. I successfully connected to printer's Bluetooth, but nothing happen when I want to print. I used an Ipad to test.

Future<void> printWithDevice(BluetoothDevice device) async {
 

    
const PaperSize paper = PaperSize.mm80;
    
final profile = await CapabilityProfile.load();
   
   
print(device.state.length);

    
final gen = Generator(PaperSize.mm58, await CapabilityProfile.load());
    
final printer = BluePrint(chunkLen: 512);

    
printer.add(gen.qrcode('https://altospos.com'));
    
printer.add(gen.text('Hello'));
    
printer.add(gen.text('World', styles: const PosStyles(bold: true)));
    
printer.add(gen.feed(1));
    
await printer.printData(device);
    
//device.disconnect();
  

}

Please I need help, I spent 5 days to find a solution. Excuse me for my english!

1 Answers

I using bixolon printer for android device. For printing use the native bixolon sdk for android and get connection by platform channel. For handelling bluetooth connection , using an flutter bluetooth package on pub.dev . For solve problem like me , need native sdk of your printer .

Related