throw new NullPrintServiceException(err);
} else if (rawCmds == null) {
throw new NullCommandException(err);
}
SimpleDoc doc = new SimpleDoc(rawCmds.getBytes(), docFlavor, docAttr);
DocPrintJob pj = ps.createPrintJob();
pj.addPrintJobListener(new PrintJobListener() {
public void printDataTransferCompleted(PrintJobEvent pje) {
JZebraTools.log(pje);
}
public void printJobCompleted(PrintJobEvent pje) {
JZebraTools.log(pje);
}
public void printJobFailed(PrintJobEvent pje) {
JZebraTools.log(pje);
}
public void printJobCanceled(PrintJobEvent pje) {
JZebraTools.log(pje);
}
public void printJobNoMoreEvents(PrintJobEvent pje) {
JZebraTools.log(pje);
}
public void printJobRequiresAttention(PrintJobEvent pje) {
JZebraTools.log(pje);
}
});
JZebraTools.log("Sending print job to printer: \"" + ps.getName() + "\"");
pj.print(doc, reqAttr);
return true;
}