Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TicketImage not visible #48

Open
mb812 opened this issue Jul 12, 2021 · 3 comments
Open

TicketImage not visible #48

mb812 opened this issue Jul 12, 2021 · 3 comments

Comments

@mb812
Copy link

mb812 commented Jul 12, 2021

I'm not able to print a 128x128 full black image (or any other image).

TicketImage code:

        Block.defaultFeedPoints = 30
        
        var ticket = Ticket()
        ticket.feedLinesOnTail = 3
        ticket.feedLinesOnHead = 0

        ticket.add(block: .image(UIImage(named: "black")!, attributes: TicketImage.PredefinedAttribute.alignment(.center)))
        ticket.add(block: .title("TEST"))
        ticket.add(block: .text(.init(content: "TEST", predefined: .alignment(.left))))
        ...

        ... print

Should this depend on the printer device?
I'm using a GOOJPRT PT-210 thermal printer.

Everything else works great!

@developerGM
Copy link

@KevinGong2013 any news about this task?

@burin-t
Copy link

burin-t commented May 20, 2022

Check the scale of image (image.scale) or resize it to 1x scale and image width must mod 8 = 0

@KevinGong2013
Copy link
Owner

Printer has been rewrite.

Please try this code.

let receipt = Receipt(.🖨️58(.ascii))
<<~ .style(.initialize)
 <<< Image(cgImage)
<<~ .page(.printAndFeed(lines: 1))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants