-
Re: Different papers sizes on Zebra printers
Manuel Caicedo-RiveraFeb 20, 2017 1:40 PM (in response to Carlo De Filippo)
Hi Carlo,
With the correct DPI and the correct model printer you can adjust the size of the label format to fit the paper size, so you can a have a label format for a 200 DPI, another label format for a 300 DPI, and one more for 600 DPI. You can have these as static versions or you can develop an algorithm to adjust them in running time. With the printer model you easily can identify the maximum print width, so if this printer is a 2", 3", 4" or 6" width.
How can you identify the DPI of the printer, and the model of the printer? Ok, there is a simple ZPL command that allows you to define what type of printer and dpi you have. "~HI". More information in how to use this command. Please, go the link below pag. 196.
https://www.zebra.com/content/dam/zebra/manuals/en-us/software/zpl-zbi2-pm-en.pdf
You could also use a SGD command like the "head.resolution.in_dpi", but it only works for Link-OS printers. Page 717, in the ZPL programming guide.
The advantage of Browser Print driver is the bi-directional capability, so you can make these requests to the printer, and the printer will give you the information you need for solving the problem. The below JavaScript function will help you to implement the logic you need to difference the dpi and send the right label format to the printer you are using at that moment. You can infere how we use the JavaScript function to implement the checking Printer status.
sendThenRead(dataToSend, finishedCallback, errorCallbackopt)
Send data to the device, then read a response back
Parameters:
Name Type Attributes Description dataToSend
string The data to be sent to the device finishedCallback
function The function that is called when reading is completed. errorCallback
function <optional> The function that is called when an error occurs while sending or reading data. - Here an example with the command "~HQES":
function checkPrinterStatus(finishedFunction)
{
selected_printer.sendThenRead("~HQES",
function(text){
var that = this;
var statuses = new Array();
var ok = false;
var is_error = text.charAt(70);
var media = text.charAt(88);
var head = text.charAt(87);
var pause = text.charAt(84);
// check each flag that prevents printing
if (is_error == '0')
{
ok = true;
statuses.push("Ready to Print");
}
if (media == '1')
statuses.push("Paper out");
if (media == '2')
statuses.push("Ribbon Out");
if (media == '4')
statuses.push("Media Door Open");
if (media == '8')
statuses.push("Cutter Fault");
if (head == '1')
statuses.push("Printhead Overheating");
if (head == '2')
statuses.push("Motor Overheating");
if (head == '4')
statuses.push("Printhead Fault");
if (head == '8')
statuses.push("Incorrect Printhead");
if (pause == '1')
statuses.push("Printer Paused");
if ((!ok) && (statuses.Count == 0))
statuses.push("Error: Unknown Error");
finishedFunction(statuses.join());
}, printerError);
};
Thanks,
MC
-
Re: Different papers sizes on Zebra printers
Carlo De Filippo Feb 21, 2017 4:15 AM (in response to Manuel Caicedo-Rivera)Hi Manuel,
many thanks for your exhaustive response.
I've a ZEBRA TLP 2844 and when I use selected_printer.sendThenRead("~HQES"... to make request to the printer, it seems to produce a code not recognised for the script checking the printer status (I see that it checks: var media = text.charAt(88), but I've noticed that the bit string is not corresponding to the real printer status (infact, the javascript always give me a write error if I do this control).
Maybe the ZEBRA TLP 2844 is not supported for the browser printing ?
Greeetings,
Carlo
-
Re: Different papers sizes on Zebra printers
Manuel Caicedo-RiveraFeb 21, 2017 2:20 PM (in response to Carlo De Filippo)
Hi Carlo,
Yes, you are right, Browser Print does not support TLP 2844 printer. This printer is already discontinued and it is not supported any more. For more information about this printer, please, review the link below.
TLP 2844 Desktop Printer Support & Downloads | Zebra
The replacement printer for the TLP 2844 is the GC420 printer.
Value Desktop Printers | Zebra
If you want to know what printers are supported actually with Browser Print, please, review the link below. It is possible that in future releases, we will add more printers to the supported list.
Browser Print SDK | Link-OS | Zebra
Thanks,
MC
-