GithubHelp home page GithubHelp logo

Comments (17)

firdaus48 avatar firdaus48 commented on August 29, 2024 1

@VictorCoding this issue has been solved, with update the latest SDK that supported QL-1110NWB model.

Thank u

from cordova-brother-label-printer.

VictorCoding avatar VictorCoding commented on August 29, 2024

are you including data:image/png;base64, if so you shouldn't. just include everything else after that.

from cordova-brother-label-printer.

gordol avatar gordol commented on August 29, 2024

Correct, you should only send the image data. It does not specify to use a data URL, but base64 encoded image.

printViaSDK takes one parameter, which is a base64 encoded bitmap image. The result should be a status code that is passed directly from the SDK. The status codes are documnted in the Brother SDK Appendix in section 4.2.2.5.Error Code. If everything works, the response should be "ERROR_NONE".

from cordova-brother-label-printer.

chetuBhadra93 avatar chetuBhadra93 commented on August 29, 2024

Hello,
Thanks for your response.
I tried that too. But when i pass base64 string without data:image/png;base64, the app is crashed.
So can you provide me a sample code for it.

When I try to debug in BrotherPrinter.java file, I note one thing I got base64 image but my application is crashed when "mBitmapPrint.print();" is called.

Thanks in advance.

from cordova-brother-label-printer.

gordol avatar gordol commented on August 29, 2024

@chetuBhadra93 can you share your code?

What platform are you on?

Have you tried the master branch?

I cannot vouch for the validity of the dev branch, as it is un-tested.

from cordova-brother-label-printer.

chetuBhadra93 avatar chetuBhadra93 commented on August 29, 2024

Hello,
Thanks for response.
I am using android platform and dev branch.

from cordova-brother-label-printer.

gordol avatar gordol commented on August 29, 2024

Does the master branch work for you? @chetuBhadra93

from cordova-brother-label-printer.

chetuBhadra93 avatar chetuBhadra93 commented on August 29, 2024

Yes, I tried master branch. I got printer in findPrinter but when i call printViaSDK it does not give any error but it also not printing anything. And when i try to debug I log this info.
"Model: QL_720NW Port: NET PrintMode: ORIGINAL Orientation: PORTRAIT PaperSize: CUSTOM ipAddress: 192.168.x.xx macAddress: 54:xx:xx:xx:xx:xx"

My model number is: QL-810.

what should i pass for my model in this code
"myPrinterInfo.printerModel = PrinterInfo.Model."

Can you please help me to figure out this issue..?

from cordova-brother-label-printer.

chetuBhadra93 avatar chetuBhadra93 commented on August 29, 2024

I successfully print label for Model QL-810 using Master branch for android platform.

from cordova-brother-label-printer.

firdaus48 avatar firdaus48 commented on August 29, 2024

Hello,
I am getting following error after calling printViaSDK.

Error: "Unexpected Internal System Error: IllegalArgumentException"

using printer brother QL-1110NWB

Thank you. please help

from cordova-brother-label-printer.

VictorCoding avatar VictorCoding commented on August 29, 2024

@firdaus48 can you show us your code?

from cordova-brother-label-printer.

yogeshshsf avatar yogeshshsf commented on August 29, 2024

Hi, i am getting error while calling printViaSDK. The error is 'The passed in data did not seem to be a decodable image. Please ensure it is a base64 encoded string of a supported Android format'.
I have excluded data:image/png;base64 as mentioned by @VictorCoding. can someone help me on this please, thanks in advance.

cordova.plugins.brotherPrinter.findNetworkPrinters((data)=>{
        var printerResponse = data[0];
        var printer = {
          "model": printerResponse.model,
          "port": printerResponse.port,
          "modelName": printerResponse.modelName,
          "ipAddress": printerResponse.ipAddress,
          "macAddress": printerResponse.macAddress,
          "nodeName": printerResponse.nodeName,
          "location": ""
        }

        cordova.plugins.brotherPrinter.setPrinter(printer, function (success) {
          var imageString = base64Image.split(',')[1];
          var dataArray = {
            "base64String": imageString,
            "numberOfCopies": 1
          };
          cordova.plugins.brotherPrinter.printViaSDK([dataArray], (data) => {
            console.log('print success');
          }, (error)=> {
            console.log('error:', error);
          })
        });
      },(err)=>{
          console.log("Error");
          console.log(err)
});`
   

from cordova-brother-label-printer.

VictorCoding avatar VictorCoding commented on August 29, 2024

Hi, i am getting error while calling printViaSDK. The error is 'The passed in data did not seem to be a decodable image. Please ensure it is a base64 encoded string of a supported Android format'.
I have excluded data:image/png;base64 as mentioned by @VictorCoding. can someone help me on this please, thanks in advance.

cordova.plugins.brotherPrinter.findNetworkPrinters((data)=>{
        var printerResponse = data[0];
        var printer = {
          "model": printerResponse.model,
          "port": printerResponse.port,
          "modelName": printerResponse.modelName,
          "ipAddress": printerResponse.ipAddress,
          "macAddress": printerResponse.macAddress,
          "nodeName": printerResponse.nodeName,
          "location": ""
        }

        cordova.plugins.brotherPrinter.setPrinter(printer, function (success) {
          var imageString = base64Image.split(',')[1];
          var dataArray = {
            "base64String": imageString,
            "numberOfCopies": 1
          };
          cordova.plugins.brotherPrinter.printViaSDK([dataArray], (data) => {
            console.log('print success');
          }, (error)=> {
            console.log('error:', error);
          })
        });
      },(err)=>{
          console.log("Error");
          console.log(err)
});`
   

Maybe the base64 is corrupted? I would validate that it's actually valid just for a sanity check. Stick it in an image tag to verify.

from cordova-brother-label-printer.

yogeshshsf avatar yogeshshsf commented on August 29, 2024

@VictorCoding it is a valid image i am display while printing the badge <img src="{{base64Image}}" width="200" height="200">

from cordova-brother-label-printer.

VictorCoding avatar VictorCoding commented on August 29, 2024

@yogeshshsf welp, no idea then 🤷‍♂

from cordova-brother-label-printer.

gordol avatar gordol commented on August 29, 2024

from cordova-brother-label-printer.

yogeshshsf avatar yogeshshsf commented on August 29, 2024

@gordol how to convert base64string to bitmap?

from cordova-brother-label-printer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.