masatomizuta / py-brotherlabel

Raster print package for Brother P-Touch label printers
GNU General Public License v3.0
12 stars 7 forks source link

Half-cut position is slightly off #2

Open PiQuer opened 2 years ago

PiQuer commented 2 years ago

First of all thank you so much for this fantastic driver, I have been looking for a while to get my PT-P900W talk to Linux!

I'm using a 6mm tape, scaled the label_12mm.png down by 50% to a 29 x 75 pixel image and used the following code:

#!/usr/bin/env python

import brotherlabel
from PIL import Image

backend = brotherlabel.USBBackend("usb://0x04f9:0x2085")
printer = brotherlabel.PTPrinter(backend)
printer.quality = brotherlabel.Quality.high_quality
printer.tape = brotherlabel.Tape.TZe6mm
printer.margin = 0

print(printer.get_status().to_string())

img = Image.open('label_6mm.png')
print(printer.print([img, img]).to_string())

It prints "Example" two times as intended, but the half-cuts are not positioned well. The upper bar of the "E" is cut off, and below the text there is a margin of about 2mm to the next half-cut. In the original image there is no margin. I experimented a bit with printer.margin=2, but that did not seem to have any effect.

Probably I will be able to work around this by having an extra margin in the image, but maybe there are some settings that I have overlooked?

Thanks for your support!

masatomizuta commented 4 weeks ago

The margin property adds the margin equally before and after the image (refer to the reference manual on page 37). The cut line location of these printers is not very accurate and tends to shift after many prints. You can reset it by pressing the Cut button on the printer. Precise margin adjustments can also be made within the image data itself instead of specifying the margin to the printer.