Closed ManjotGujariya closed 1 year ago
For some reasons it's printing Weird text. This is my code:
var ticket = Ticket( .title("App name"), .blank, .plainText("Customer name"), .plainText("1234567890"), .blank, .text(.init(content: Date().description, predefined: .alignment(.center))), .blank, .kv(k: "Merchant ID:", v: "iceu1390"), .kv(k: "Terminal ID:", v: "29383"), .blank, .kv(k: "Transaction ID:", v: "0x000321"), .plainText("PURCHASE"), .blank, .kv(k: "Sub Total", v: "USD$ 25.09"), .kv(k: "Tip", v: "3.78"), .dividing, .kv(k: "Total", v: "USD$ 28.87"), .blank(3), Block(Text(content: "Thanks for supporting", predefined: .alignment(.center))), .blank, .text(.init(content: "THANK YOU", predefined: .bold, .alignment(.center))) ) ticket.feedLinesOnHead = 0 ticket.feedLinesOnTail = 0 if bluetoothPrinterManager.canPrint { bluetoothPrinterManager.print(ticket) } else { dummyPrinter.print(ticket) }
Correct data encoding is required.
// ASCII let receipt = Receipt(.🖨️58(.ascii))
// 中文 let receipt = Receipt(.🖨️58(String.GBEncoding.GB_18030_2000))
For some reasons it's printing Weird text. This is my code: