Hello Forum people
Has anyone experienced the "malformed response" error from printer status checking as per the code below..?
ZebraPrinter printer = ZebraPrinterFactory.getLinkOsPrinter(connection);
PrinterStatus printerStatus = printer.getCurrentStatus();
I have seen multiple hits on this on the forum .... but no resolution.
Anyone got any insights..?
Thanks
1 Replies
What's the printer model on which the malformed error happens?
Most common cause of the malformed error is due to the mismatch of the setting of device.languages on the printer. By default, the ZebraPrinterFactory.getLinkOsPrinter(connection) returns an instance of a ZPL printer. If the device.languages setting on the printer is CPCL or line_print mode, however, calling the printer.getCurrentStatus() likely triggers the malformed error. To get around this, we can query the device.languages setting on the printer first via the SGD API. Then we obtain the proper instance of the printer through ZebraPrinterFactory.getLinkOsPrinter(language, connection) with the language type returned from the device.languages SGD.