AndBondStyle / niimprint

Python library for Niimbot label printers. Supports D11/B21/B1 via bluetooth or USB.
MIT License
202 stars 29 forks source link

Clean space when i print the image with 50X30mm tag #21

Open TeschRenan opened 5 months ago

TeschRenan commented 5 months ago

I'm testing the code and after set to print one tag my tag is clean in the last spacke nex to border from tag, in this case i'm testing this imagem.

image

The space that contains the red rectangle not printing.

My printer is B1 and i use this command to execute python niimprint -m b1 -c usb -a COM19 -d 3 -i .\RenovatioMed-Adesivo.png

MoshiBin commented 5 months ago

Looks like another instance of #3

TheZoc commented 4 months ago

@TeschRenan That is due to the timer in https://github.com/AndBondStyle/niimprint/blob/main/niimprint/printer.py#L114

The correct way is to poll the printer until it's done printing and send the end_print command to complete it, instead of relying on a timer. I've done that on my fork ( TheZoc/niimprint )

In case you don't want to use a fork and don't want to make complicated changes in here, you can just increase that timer from 0.3 to 1.0 (or so) and it will print everything (though a bit slower)

TeschRenan commented 4 months ago

Excellent, I'll test this feature today.

Thank you @TheZoc.

rubeycubey commented 4 months ago

Had this same issue, also a B1. Tried changing it to 1.0, but still not printing bottom quarter of file.

TheZoc commented 4 months ago

@rubeycubey The timer must be above self.end_page_print()

You could also use the fork that has that fixed already (but it requires python 3.12 for now, until I update it)