-
Notifications
You must be signed in to change notification settings - Fork 57
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
How to know which device supports Zpl or CPCL? #18
Comments
A printer can only support CPCL or ZPL at a time. It cannot support both CPCL & ZPL at the same time. The setting of the device.languages on the printer determines which label format language the printer is going to support. The application can switch the label format language at run time with the device.languages SGD (! U1 setvar "device.languages" "zpl", or ! U1 setvar "device.languages" "cpcl"). The application can also query the languages setting with the device.languages SGD (! U1 getvar "device.languages"). Once the device.languages setting on the printer is known, the application can call the getInstance() with the proper parameter, i.e., either |
@ssizebra Sorry for misunderstanding, I was saying I have two devices. One device supports ZPL and other device (ZQ210) supports CPCL Language. |
As mentioned early, we can use the device.languages SGD to query the printer's language as below.
If the ptrLangStr contains "cpcl" or "line_print", then the printer's language is set as CPCL. If the ptrLangStr contains "zpl", then the printer is in ZPL. Then we can create the proper printer instance with the correct language parameter. |
@ssizebra Thanks a lot its really helpful. |
@ssizebra can you please tell me how can I show all the connected zebra printers list in my app? |
Hi,
I have both Zebra Printing Devices which support ZPL and CPCL Languages.
So I want to distinguish between both devices.
I have reviewed your code, you are writing this in everywhere in your code -> ZebraPrinterFactory.getInstance(printerConnection)
If I define printer with this line -> printer = ZebraPrinterFactory.getInstance(printerConnection)
It always give me ZPL language.
But if I write this line -> printer = ZebraPrinterFactory.getInstance(PrinterLanguage.CPCL,printerConnection)
It always return me CPCL language.
Kind give me best answer. I'm looking for your response.
Thanks
The text was updated successfully, but these errors were encountered: