KevinGong2013 / Printer

Swift ticket printer framework for ESC/POS-compatible thermal printers.
Apache License 2.0
144 stars 72 forks source link

Not able to print Image and Qr code #67

Open saniaaaaa opened 1 year ago

saniaaaaa commented 1 year ago

Hi, Not able to print Image and Qr code, it's working fine for text

i am using Printer Panda PRJ-R80B,

here's the code let receipt = Receipt(.init(maxWidthDensity: 500, fontDesity: 12, encoding: .utf8)) <<~ .style(.initialize) <<< Image(cgImage) <<< QRCode(content: "https://www.yuxiaor.com") <<~ .page(.printAndFeed(lines: 2))

if bluetoothPrinterManager!.canPrint { bluetoothPrinterManager!.write(Data(receipt.data)) }

dummyPrinter!.write(Data(receipt.data))

and this is the output I get

Screen Shot 2023-03-08 at 17 07 51

Please help me, Thank you

bostagintings commented 1 year ago

I have the same issue, can anybody please help @KevinGong2013

Muhammadbarznji commented 1 year ago

Hi @saniaaaaa, About image issue rename it, because the Image is swiftUI struct.