我测试了Internet上所有可用的代码,但未找到解决方案。当我将PDF打印为数据表单时,打印机会打印随机数。
以下是用于HOIN打印机的IOS SDK(适用于ble):HOIN SDK
let ble = BLElib()
ble.connect(peripheral)
do {
if let pdf = Bundle.main.url(forResource: "Thai", withExtension: "pdf", subdirectory: nil, localization: nil) {
let data = try Data(contentsOf: pdf)
delegate.printMyData(data: data)
}
}
catch { }
}
ble.send(data)