Currently, I am engaged in the development of an Android app utilizing .NET Maui.
However, I am encountering an issue with my Zebra ZQ320 Plus printer, which is currently running Link OS.
The problem arises when I attempt to print an image using the printing function provided by the Zebra Link OS Sdk. Instead of printing the actual image content, the printer outputs a lengthy string that, while accurately describing the image in string format, does not actually print out the actual image.
Does the Zebra ZQ3320+ have the necessary support to address this issue and print the image content as intended?
var connection = new BluetoothConnection(deviceAddress);
connection.Open();
using var stream = await FileSystem.OpenAppPackageFileAsync("logo_cobranza2.png");
Debug.Write(stream);
var tempFilePath = Path.Combine(FileSystem.CacheDirectory, "temp_logo_cobranza2.png");
using (var fileStream = new FileStream(tempFilePath, FileMode.Create, FileAccess.Write))
{
await stream.CopyToAsync(fileStream);
}
var printerInstance = ZebraPrinterFactory.GetInstance(connection);
int x = 0;
int y = 0;
printerInstance.PrintImage(tempFilePath, x, y);
byte[] bytBuffer = System.Text.Encoding.GetEncoding(0).GetBytes(textContent);
connection.Write(bytBuffer);
connection.Close();
Everything that comes after the printerInstance.PrintImage prints correctly and as intended. Its just that one that prints out as a huge String instead of the image.
1 Replies
If the printerInstance.PrintImage() prints a garbage like text string, it's most likely the device.languages setting on the ZQ320 is set to line_print model. You can use the Zebra Printer Setup app to verify the device.langauges setting on the printer. By default, the ZebraPrinterFactory.GetInstance(connection) returns a ZPL printer instance, and the subsequent statement of printerInstance.PrintImage(tempFilePath, x, y) tries to convert the image file into ZPL format before sending the converted ZPL to the ZQ320 to print. If the device.languages setting on the ZQ320 is set to line_print, then the ZQ320 prints everything it receives as text on the label instead of image.