4

when i try to print paper with the aidl class the exception is thrown in my fragment class

       com.iposprinter.iposprinterservice E/JavaBinder: *** Uncaught remote exception!  (Exceptions are not yet supported across processes.)
java.lang.ArrayIndexOutOfBoundsException: length=4032; index=4032

my other codes in fragment class is below

first one is initiate printer

       public void initPrinter() {
ThreadPoolManager.getInstance().executeTask(new Runnable() {
    @Override
    public void run() {
        try {
            mIPosPrinterService.printerInit(callback);
        } catch (RemoteException e) {
            e.printStackTrace();
        }
    }
});}

and this is the code to print text if printer status is ready

             public void printText()
{
    ThreadPoolManager.getInstance().executeTask(new Runnable()
    {

        @Override
        public void run()
        {


            try {
                mIPosPrinterService.printSpecifiedTypeText("  GLOWSIS TECHNOLOGIES\n", "ST", 42, callback);
                mIPosPrinterService.printSpecifiedTypeText("         " + "Educare IT Park,Tiroorangadi\n", "ST", 24, callback);
                mIPosPrinterService.printSpecifiedTypeText("04942405643,9633332673\n", "ST", 42, callback);
                mIPosPrinterService.printSpecifiedTypeText("--------------------------------\n", "ST", 24, callback);
                mIPosPrinterService.printerPerformPrint(160,  callback);
            }catch (RemoteException e){
                e.printStackTrace();
            }
        }
    });
}

my logcat is below

             01-28 14:09:12.820 3450-3719/com.iposprinter.iposprinterservice E/JavaBinder: *** Uncaught remote exception!  (Exceptions are not yet supported across processes.)
java.lang.ArrayIndexOutOfBoundsException: length=4032; index=4032
    at com.iposprinter.iposprinterservice.corealgorithm.FontMethod.getPrintDataFromFont(FontMethod.java:552)
    at com.iposprinter.iposprinterservice.corealgorithm.PrinterInteractiveMethod.printerPrintSpecTypeText(PrinterInteractiveMethod.java:344)
    at com.iposprinter.iposprinterservice.IPosPrintService$1.printSpecifiedTypeText(IPosPrintService.java:186)
    at com.iposprinter.iposprinterservice.IPosPrinterService$Stub.onTransact(IPosPrinterService.java:152)

0 Answers0