Closed ll-venkat-n closed 2 years ago
This is a sample https://www.neodynamic.com/articles/How-to-trace-Print-Job-Status-from-Javascript/
The event info is returned by the printer driver. All those update events are "accumulative" and for the print job to be completed and successful you should keep tracking both completed-pages
and total-pages
. Both could return "null" or a digit. If both ends being a digit and equal, then it can be considered that printing was successful
i tried both those onUpdated and onFinished and onError and only OnError calling and onFinished or onUpdated not calling at all. am i missing something ?
here is my code :
public static printLabel(printCommands: string, printerType: LabelType): Promise
JSPM.JSPrintManager.getPrinters().then(function (printersList) {
console.log('printersList' + printersList)
});
clientPrintJob.printerCommands = printCommands;
// console.log(clientPrintJob.printerCommands);
clientPrintJob.onUpdated = function (data) {
console.info('########onUpdated' + JSON.stringify(data));
};
clientPrintJob.onUpdate = function (data, last) {
console.info('########onUpdate' + JSON.stringify(data));
console.info('########last' + last);
};
clientPrintJob.onFinished = function (data) {
console.info('##########onFinished' + JSON.stringify(data));
};
clientPrintJob.onError = function (data) {
console.info('onError####' + JSON.stringify(data));
};
return clientPrintJob.sendToClient();
}
}
Only error cases like printer Name wrong , i am getting onError event only and onFinished call for error only not for success.
Print Job status is available when printing files and not when printing raw commands as in your case.
how do we check status in our case as we need to print [Zebra ZPL] so if print fails or any issues how to stop and get success status or print. Really if you have some suggestions.
In that case you should send the appropriate ZPL commands to know the printer status but BIDI comm through the driver is not supported by our product. Our product supports Serial port BIDI comm only.
Could you please share more details on BIDI comm this is the first time we are integrating. our requirements is
if we have different approach or any other alternatives also please suggest. we are planing to buy license soon.
As we wrote before, if your printer is NOT connected through a COM port, then our product cannot be used to get info from the printer
I notice this issues was closed marked with COMPLETED, is it means this feature was finished on v7.0?
Hi, do we any event to know the status of print job ?
On success of printjob, we need to do extra task but current we do not have a way to track.
we have onError or onFinished but not for success.
if error we should stop next action and if success do some Database operation so any better way to do this.