Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternative Printing: Spaces in printer name cause failure #20

Closed
macarenomarco opened this issue Mar 31, 2016 · 3 comments
Closed

Alternative Printing: Spaces in printer name cause failure #20

macarenomarco opened this issue Mar 31, 2016 · 3 comments

Comments

@macarenomarco
Copy link

I'm currently running

  • OS X 10.10.5
  • CUPS 2.0.0
  • QZ Tray 2.0.0
  • java -version output:
    java version "1.8.0_60"
    Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
    Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
  • Zebra ZTC_GX420t

When attempting to print (using altPrint: true) I ran into:
Alternate printing returned a non-zero value(1).

After some directly logging the command being used if found out it was using the following:
/usr/bin/lp -d "Zebra Technologies ZTC GX420t" -o raw "/var/folders/vw/t8cm364n2q51d_hsrwqpcdp40000gn/T/qz_raw_4797437088864693128.tmp";

And after manually attempting to run it, it would output the following:
lp: The printer or class does not exist.
Which was causing the non-zero return value.
It all came down to the fact that while the javax PrintServiceLookup was returning the name Zebra Technologies ZTC GX420t
The output of lpstat was the following:

printer KONICA_MINOLTA_bizhub_C35_DB_7E_F9_ is idle.  enabled since Wed Sep 30 15:33:22 2015
printer Samsung_M2020_Series__SEC30CDA7AFF793_ is idle.  enabled since Wed Mar 23 20:10:45 2016
printer Zebra_Technologies_ZTC_GX420t is idle.  enabled since Wed Mar 30 20:52:49 2016
    Sending data to printer.
system default destination: Zebra_Technologies_ZTC_GX420t

It seems to be that PrintServiceLookup interprets the spaces correctly while lpstat changes them to underscores.

@tresf
Copy link
Contributor

tresf commented Mar 31, 2016

Good find and thanks for the research.

Here's a more thorough explanation, scroll to the Exceptions section. #17

Edit: Also please be careful of this bug: qzind/qz-print#131 (comment)

We'll leverage the new getCupsPrinters() shell utility, once merged and patch the alternate printing method as well.

@macarenomarco
Copy link
Author

All right, thanks c:

@tresf tresf closed this as completed in 3680d9f Apr 4, 2016
@tresf
Copy link
Contributor

tresf commented Apr 4, 2016

Fixed via 3680d9f. This will be available in the next release (either RC4 or 2.0.0 official)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants