KevinGong2013 / Printer

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

multiple item #47

Closed chitranjank closed 1 year ago

chitranjank commented 3 years ago

how to print multiple item in one by one dynamically? can I write (var ticket = Ticket()) for loop?

KevinGong2013 commented 3 years ago

sure.

chitranjank commented 3 years ago

any example?

chitranjank commented 3 years ago

how to print multiple item in one by one dynamically? can I write (var ticket = Ticket()) for loop?

chitranjank commented 3 years ago

hello Kevin

tanalavijay commented 2 years ago

use add block concept for this example: self.ticket.add(block: Block(Text(content: tipData, predefined: .bold , .alignment(.left)))) self.ticket.add(block: Block(Text(content: totData, predefined: .bold , .alignment(.left))))

KevinGong2013 commented 1 year ago

let receipt = Receipt(.🖨️58(.ascii))

receipt.append(item: "dynamically")
receipt.append(item: "content" <<~ .style(.underlineMode(.enable2dot)))
receipt.append(item: Image(cgImage) <<~ .layout(.justification(.center)))