本文介绍了JNI在Brother SDK上的应用程序中检测到错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的应用程序中的Brother SDK中打印图像.

Im trying to print a image in Brother SDK in my app.

这是我的代码:

       `myPrinterInfo = myPrinter.getPrinterInfo();
        myPrinterInfo.printerModel = PrinterInfo.Model.QL_810W;
        myPrinterInfo.port = PrinterInfo.Port.NET;
        myPrinterInfo.printMode = PrinterInfo.PrintMode.FIT_TO_PAGE;
        myPrinterInfo.paperSize = PrinterInfo.PaperSize.CUSTOM;
        myPrinterInfo.labelNameIndex = 5;
        myPrinterInfo.isAutoCut = false;
        myPrinterInfo.isCutAtEnd = false;
        myPrinterInfo.orientation = PrinterInfo.Orientation.PORTRAIT;
        myPrinterInfo.valign = PrinterInfo.VAlign.TOP;
        myPrinterInfo.align = PrinterInfo.Align.LEFT;
        myPrinterInfo.halftone = PrinterInfo.Halftone.THRESHOLD;
        myPrinterInfo.ipAddress = "192.168.1.146";
        myPrinterInfo.thresholdingValue = 127;
        myPrinterInfo.pjCarbon = false;
        myPrinterInfo.pjDensity = 5;
        myPrinterInfo.pjFeedMode = PrinterInfo.PjFeedMode.PJ_FEED_MODE_FIXEDPAGE;
        myPrinterInfo.pjPaperKind = PJ_CUT_PAPER;
        myPrinterInfo.rollPrinterCase = PrinterInfo.PjRollCase.PJ_ROLLCASE_OFF;
        myPrinterInfo.paperPosition = PrinterInfo.Align.CENTER;
        myPrinterInfo.numberOfCopies = 1;

我正在使用62mmx100mm的纸卷,却收到此错误消息:

Im using the 62mmx100mm paper roll and I got this error message:

如果有人知道如何解决它,请帮助我:(

If anyone knows how to fix it, please help me :(

推荐答案

我今天也遇到了类似的问题,结果是未授予android.permission.WRITE_EXTERNAL_STORAGE权限.如果您运行的是Android 6或更高版本,请检查您的运行时权限写入外部存储.在清单中声明许可是不够的.兄弟文档在其手册的末尾对此进行了提示.

I had a similar problem today, it turns out the android.permission.WRITE_EXTERNAL_STORAGE permission was not granted. If you are running on and Android 6 or greater, check your run time permissions for writing to the external storage. Declaring the permission in the manifest is not enough. The brother documentation hints at this at the end of their manual.

这篇关于JNI在Brother SDK上的应用程序中检测到错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 18:00