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

Print multiple copies at once #40

Open
melkumovarthur opened this issue Jan 25, 2025 · 1 comment
Open

Print multiple copies at once #40

melkumovarthur opened this issue Jan 25, 2025 · 1 comment

Comments

@melkumovarthur
Copy link

Hi,

Thank you so much for your amazing work on this library—it's been incredibly helpful!

I'm using your library with a Niimbot D11h and USB-Con on a Linux PC, and overall, it's been a great experience. However, I encountered an issue when trying to print multiple copies at once.

I noticed the commented line in print.py:
# self.set_quantity(1) # Same thing (B21)

When I uncomment it and set the value to, say, 2, it doesn't seem to have any effect (still prints 1pcs). Is there a way to print multiple stickers at once using your library?

Thanks again for your hard work, and I appreciate your help!

@MultiMote
Copy link

For d11h print quantity is encoded to SetPageSize(0x13) packet (6 data bytes). Also total page count should be encoded to PrintStart(0x01) packet (7 data bytes).

See the reference implementation here:

https://github.com/MultiMote/niimbluelib/blob/main/src/print_tasks/B1PrintTask.ts#L9-L29

https://github.com/MultiMote/niimbluelib/blob/4e1199338074aab030638b47304c3a3e0ad78564/src/packets/packet_generator.ts#L169

https://github.com/MultiMote/niimbluelib/blob/main/src/packets/packet_generator.ts#L110-L114

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

No branches or pull requests

2 participants