qzind / qz-print

Archive for legacy qz-print versions (1.8, 1.9). See https://github.com/qzind/tray for modern versions.
Other
141 stars 101 forks source link

Printer not found on OS X #131

Closed tresf closed 8 years ago

tresf commented 8 years ago

There'a bug with the printer Class Name on OSX where the class name can prevent the printer from being found.

I'm almost certain this is a mac-only bug and it seems to have surfaced with OS X 10.11 El Capitan.

@klabarge can you please reproduce on 10.11 and update the documentation here:

https://qz.io/wiki/setting-up-a-raw-printer-in-osx#adding-a-printer-class

We currently state that the Class name can't match the Printer name, but according to the emails we're receiving this may be slightly incorrect.

klabarge commented 8 years ago
  1. The statement that the Class Name cannot match the Printer Name is correct. CUPS does not allow you to create a Class Name that already exists as a Printer Name.

    image

  2. In my testing I used the following information:

    Printer Name: printer_name Printer Description: printer_name

    Printer Class: printer_class Class Description: printer_name

    • Using "Detect Printer" resulted in:

      image

    • Using "List All Printers" resulted in:

      image

    • printer_name showed up in System Preferences

      image

  3. When I changed the Class Description to _printername, both _printername and _printerclass showed up in "List All Printers"

    image

    • After changing the Class Description, the Printer Name in System Preferences changes

    image

In all my testing, I was able to use "Detect Printer" to find the printer.

This may require further testing, as it is clear that there is a discrepancy between the Printer name/description and the Printer class/description

klabarge commented 8 years ago

The only printer attached to the system was Apple.

CUPS Printer

CUPS Class

Testing

  1. List All Printers via qz.findPrinters()

    When these fields are all different, the printer name (Apple) and the class name (Cat) both show using "List All Printers"

    image

  2. Detect Printer:

    • Apple: via qz.findPrinter("apple") image

      image

    • Banana: via qz.findPrinter("banana") image
    • Cat: via qz.findPrinter("cat") image
    • Dog: via qz.findPrinter("dog") image

      However, when selecting "Use Default Printer" the printer Dog is found via qz.findPrinter()

      image

    Note: It was much easier to see this bug when all four of these fields were different.

Resolution

All of these weird issues can be avoided by make the Printer Name, Printer Description, and the Class Description the same.

tresf commented 8 years ago

the printer description (Banana) and the class name (Cat) both show using "List All Printers"

This mismatches the screenshot you've provided.

All of these weird issues can be avoided by make the Printer Name, Printer Description, and the Class Description the same.

If we're 100% sure of this, we should update our wiki to reflect this, then we can close out this issue... however... AFAIK, the Printer Name has certain hard restrictions (i.e. cannot contain spaces) so this gives the ability for one to be more verbose than the other. We may want to make mention of that as well. Also, please link this bug report so that Mac users are given advanced notice of the bug.

screenshot

I think this image does a lot to explain the problem. Once our documentation is update, we can close this out as wontfix.

klabarge commented 8 years ago

This mismatches the screenshot you've provided.

You are right, I have updated my post.

I updated the wiki documentation under Step 8 for creating the printer and under Step 2 for creating the printer class.

Edit: Also added to Getting Started guide via https://qz.io/wiki/2.0-Getting-Started#find-printer. --@tresf