KevinGong2013 / Printer

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

Fatal error: Index out of range Image printing #31

Open KansV3Cube opened 4 years ago

KansV3Cube commented 4 years ago

While printing image getting this error and application crashed.

Please help me out

kaitoshadow commented 2 years ago

I got same issue :( Have you found solution?

KevinGong2013 commented 1 year ago

Printer framework has been rewrite.

can you help testing qrcode&image command?

let receipt = Receipt(.🖨️58(.ascii))
<<~ .style(.initialize)
<<< QRCode(content: "https://g.cn")
<<< Image(cgImage)
manojssas commented 1 year ago

Hi is there any way to Print Arabic langauge?

manojssas commented 1 year ago

@KevinGong2013 How to print arabic Langauge if coming from server?

KevinGong2013 commented 1 year ago

public extension String {

    struct ArabicEncoding {
        public static let windowsArabic = String.Encoding(rawValue: CFStringConvertEncodingToNSStringEncoding(CFStringEncoding(CFStringEncodings.windowsArabic.rawValue)))
    }
}

let receipt = Receipt(.🖨️58(String.ArabicEncoding.windowsArabic))