michaelrsweet / lprint

A Label Printer Application
https://www.msweet.org/lprint
Apache License 2.0
227 stars 31 forks source link

Zebra ZPL 4-inch/300dpi/Direct Thermal driver is not able to save a default media size #112

Closed zdohnal closed 8 months ago

zdohnal commented 9 months ago

I've installed my lab label printer with lprint and tried to set the correct label size - 4x6" - however the default size always gets rewritten after I save the changes and click into printer's web page in lprint and then back to 'Media' or 'Printing Defaults'.

It looks to be connected to the 'Media' and "Printing Defaults" pages - I've check that when I create printer, /etc/lprint.conf contains the correct media, however when I go to the mentioned pages, custom size is showed - 4x4.04.

Would you mind looking into it? lprint 1.2.0, pappl 1.4.2, Fedora 39

michaelrsweet commented 9 months ago

The printer might be reporting a label length of 4.04 inches. Can you attach a debug log?

michaelrsweet commented 9 months ago

Also, most of the Zebra printers have a "label calibration" process that will measure the installed label length.

zdohnal commented 9 months ago

Thank you for looking into it! I will add the debug log after New year - I have this on my list...

zdohnal commented 8 months ago

Here is the lprint log. I did:

  1. install printer in lprint - network printer, driver Zebra ZPL 4-inch/300dpi/Direct-Thermal
  2. go to printing defaults (here is incorrect size) - screenshot
  3. change the media size and type, save - screenshot
  4. go to printing defaults (size is correct) - screenshot
  5. go to the printer main page and then to printing defaults - size is again incorrect - screenshot
michaelrsweet commented 8 months ago

Are you sure you have a 300dpi Zebra printer? The length (1210) would be about 6" at 203dpi.

It does look like I might need to round the label sizes but let's fix the resolution first.

zdohnal commented 8 months ago

ok, bad on me - I suspected 300dpi and I was not able to find any settings on the machine web ui with info relevant to me, but user manual says it clearly - I have bad resolution.

And changing the driver did the trick - the media size stays around the selected size.

=============================================

To sum it up for future users - consult your machine supported resolution and PDL with your machine manual.

zdohnal commented 8 months ago

@michaelrsweet what I found out is that default size changes a little even now - from 4x6 to 4x5.94567 - is it expected due reports from the printer?

zdohnal commented 8 months ago

Hmm... looks like the default size changes more and more - now 4x5.8... maybe it counts the width of label and gives the actual width based on how perferct I tear the media?

zdohnal commented 8 months ago

The default size is continuously changing to the smaller and smaller width - probably I have something broken with media type I use - I've tried continuous + labels, web + labels, web + continuous labels, continuous + continous labels (anything with 'mark' produced many labels - the printer was not able to see mark). Media provided to the printer is like this one.

michaelrsweet commented 8 months ago

I added the "gap" method to the ZPL driver; it should be able to recognize it.

Also, I updated the media size detection code to do some rounding and "snapping" before choosing the size. Please try the latest master code...

zdohnal commented 8 months ago

Ok, web labels did the trick for several test pages (maybe the width was broken from previous attempts), so I guess it was again problem on my side - I really have spend more time with label printers.

I'll close the issue - if I see it again, I'll reopen.