Bug imprimante ticket sur MAC

Répondre
Ludo
Messages : 3
Enregistré le : lun. août 31, 2020 2:38 pm

jeu. nov. 12, 2020 6:19 pm

Bonjour,

Qui utilise OC sur MAC ? avec la caisse ?
car quand je veux imprimer sur l'imprimante Ticket (epson TM-T20iii en usb) dans "Configuration OpenConcerto" j'ai une exception qui tombe:
Erreur d'impression

invalid flavor
org.openconcerto.utils.ExceptionHandler: Erreur d'impression
...
Caused by: sun.print.PrintJobFlavorException: invalid flavor
at sun.print.UnixPrintJob.print(UnixPrintJob.java:343)
at org.openconcerto.erp.core.sales.pos.io.ESCStandardPrinter.sendBytes(ESCStandardPrinter.java:87)
at org.openconcerto.erp.core.sales.pos.io.ESCStandardPrinter.printBuffer(ESCStandardPrinter.java:48)
at org.openconcerto.erp.core.sales.pos.ui.TicketPrinterConfigPanel$1.actionPerformed(TicketPrinterConfigPanel.java:143)
... 36 more

j'ai bien sélectionné imprimante standard ESCP.
En regardant dans le code de la fonction sendbytes du module ESCStandard, la fonction possant probleme est lookupPrintServices ...
j'ai contourner le probleme en modifiant le code, voici la nouvelle fonction:


private synchronized void sendBytes(byte[] b) throws PrintException {
final PrintService[] lookupPrintServices = PrintServiceLookup.lookupPrintServices(null, null);
System.out.println(lookupPrintServices.length);
int index =-1;
for (int i = 0; i < lookupPrintServices.length; i++) {
System.out.println(lookupPrintServices.getName());
if ( printerName.equalsIgnoreCase(lookupPrintServices.getName()))
{
System.out.println("found !");
index = i;
}
}

if (index < 0) {
throw new PrintException("Printer " + this.printerName + " not found");
}


final DocPrintJob job = lookupPrintServices[index].createPrintJob();
final DocFlavor flavor = DocFlavor.BYTE_ARRAY.AUTOSENSE;
final Doc doc = new SimpleDoc(b, flavor, null);
job.print(doc, null);


}

Autre bizarrerie, j'ai aussi essayé en sélectionnant imprimante serie ESCP et en utilisant un convertisseur serie/usb, j'ai pas d'erreur, mais rien ne s'imprime. et pas de transfert (j'ai un modele avec des leds pour montrer l'activité de la ligne serie). c'est bien le module rxtxcomm.jar qui est utilsé non ? quel version ? v2.2 ? je n'ai pas trouvé le librxtxSerial.jnilib sur le svn ou sur le https://www.openconcerto.org/fr/telechargement/
il y a bien les versions pour Windows ,Linux mais pas Mac ...
Répondre