matmair / brother_ql-inventree

Python package for the raster language protocol of the Brother QL series label printers
GNU General Public License v3.0
22 stars 9 forks source link

Prevent PT printers from printing first empty label #71

Open mkildemaa opened 2 weeks ago

mkildemaa commented 2 weeks ago

On every print command the PT printer with endless pt12 label always first prints out about an inch of empty label before anything else.

I am trying to make this program work with my fully automated printing system but since the buffer size limits on these PT printers are so low I can send only 2-3 images per command / print cycle. More than that then the printer's light starts blinking red and needs manual intervention. With this method there is tons of label tape that goes to waste.

In the official Windows P-Touch program I can send queues of multiple hundreds of labels to printer and it prints them all out at once with only the initial first empty label. I wonder how is it solved there?

It would be extremely helpful (and eco-friendly) if there is somehow a way to prevent printer from feeding the inch of empty tape every time.

I have done my best to optimize the image file generations that are being sent with brother_ql so that I can send as many at once as possible but still can't get over 2-3 files.

chruetli commented 2 weeks ago

Same issue here!

https://github.com/pklaus/brother_ql/issues/114

vulpes2 commented 1 week ago

There are two separate issues we need to address to be able to fix this properly. I'll look into this and see what I can do in the upcoming weeks.

  1. Unlike P-Touch, brother-ql cannot cope with any temporary error conditions (buffer full or print head overheating) due to the lack of proper error handling routines (back off, wait until printer is ready again, and resend). The current print job serialization and sending code is in desperate need for some clean-up and refactoring, it's likely I will have to write replacements for them and mark the original as deprecated.
  2. I can definitely add an option to not terminate print jobs, but it comes with a caveat: you have to ensure absolutely nothing else is talking to the printer. brother_ql is not a daemon, so it doesn't know about the printer's current state, which is why every print job starts with those null bytes and an init command to get the printer back to a known initial state. When the printer is in the middle of processing a print job, I don't think it will respond to status queries, so you have to assume it's still able to do it and send more pages blindly.

On a side note, the blank piece of tape is fundamentally a firmware design issue on Brother's side. A new print job means a new blank piece, and there is no way to disable this behavior. Not sure what their intention is, it could be a malicious design to waste the arguably pretty expensive consumables, or it could be a poorly implemented workaround to ensure the printed label always come out perfect no matter what. Personally I think it's more of the latter, since Brother never bothered to implement DRM in their label printer consumables. The lack of DRM is the main reason I prefer Brother label printers over Dymo, despite the fact that their XML label formats are easier to work with compared to this binary raster stuff.