thiendangit / react-native-thermal-receipt-printer-image-qr

React native thermal receipt printer
https://www.npmjs.com/package/react-native-thermal-receipt-printer-image-qr
119 stars 80 forks source link

Infinite Loop of Printing when there is a printImageBase64 #118

Open miles003 opened 5 months ago

miles003 commented 5 months ago

Anyone encountered the same issue? here's the scenario after the first try of printing with printImageBase64 everything works fine but when print for the second time it prints without stopping. here's my snippet

      const printer = await BLEPrinter.connectPrinter(module.exports.globalState.state.printers.inner_mac_address);
      BLEPrinter.printImageBase64(logo, {
        imageWidth: 150,
        imageHeight: 150,
      });
      BLEPrinter.printText("<C>Sample</C>")
      BLEPrinter.closeConn()

But if i remove the print with printImageBase64 everything works fine no matter how many i print seems like there is a problem when printing printImageBase64