我想通过使用Core Bluetooth Framework将I连接到热敏打印机来打印图像/收据。
我已尝试将图像转换为数据,然后将其写入..我可以成功打印120x120像素的图像,但无法打印大于120像素的图像
let image =UIImage(名称:"demo") let data = image?.pngData()
防护let外围设备= connectedPeripheral,让characteristic = writableCharacteristic否则{ print("inside else")返回}
Peripheral.writeValue(数据,用于:特征,类型:.withoutResponse)
我也尝试过使用'Printer‘pod
我也尝试过将图像转换为位图,然后再转换为数据,还尝试使用base64字符串对其进行编码。
发布于 2021-03-09 00:30:44
有几个问题你需要问自己。
https://stackoverflow.com/questions/66527938
复制相似问题