I want to print image / Receipt by connecting I to the thermal printer using Core Bluetooth Framework.
I have tried converting image to Data and then write it..I can successfully print image with size of 120x120 pixel, but unable to print image greater than 120 pixels
let image = UIImage(named: "demo")
let data = image?.pngData()
guard let peripheral = connectedPeripheral, let characteristic = writableCharacteristic else {
print("inside else")
return
}
peripheral.writeValue(data, for: characteristic, type: .withoutResponse)
I have also tried using Printer
pod
I have also tried it by converting image to bitmap and then to data, also tried to Encode it using base64 String.