brother_ql icon indicating copy to clipboard operation
brother_ql copied to clipboard

Printer prints multiple times if Python interface is used.

Open tdonhauser opened this issue 5 years ago • 3 comments

Hello,

first of all thank you very much for your work! I found a bug using the Python interface for the printer.

The following code prints 3 times with only 2 times calling the print command:

import brother_ql
from brother_ql.raster import BrotherQLRaster
from brother_ql.backends.helpers import send

# Using USB connected printer
PRINTER_IDENTIFIER = 'tcp://131.246.248.199:9100'

printer = BrotherQLRaster('QL-720NW')

def sendToPrinter():
    filename = 'name1.png'
    print_data = brother_ql.brother_ql_create.convert(printer, [filename], '62', dither=True)
    send(print_data, PRINTER_IDENTIFIER)

sendToPrinter()
sendToPrinter()

tdonhauser avatar Apr 10 '19 16:04 tdonhauser

I'm seeing some similar oddities using the network connected version of a brother printer - it will print multiples of the same item, though not consistently. Possibly a code issue but I had to comment seeing as this seemed so similar. Will update with a code example if helpful.

baileyds avatar Jun 07 '19 14:06 baileyds

I had this issue too, I ended up solving it by creating a new raster between calls to print and not re-using it.

The issue that I was seeing in particular was that the raster would print every single image that it had been given:

I sent Image A => printer printed A

I sent Image B => printer printed B, then A

I sent Image C => printer printed C, then B, then A

After I started deleting the BrotherQLRaster and creating a new one for each send, the problem went away.

mattj23 avatar Sep 18 '19 16:09 mattj23

Can confirm, I'm having this issue with current master as well.

I'm printing labels from a loop, and I need to printer = BrotherQLRaster('QL-1050') after every print call to the printer, otherwise it prints all the previous labels.

michalmph avatar May 22 '20 14:05 michalmph