CesarBalzer / Cordova-Plugin-BTPrinter

A cordova plugin for bluetooth printer for android platform
Apache License 2.0
80 stars 63 forks source link

The printer only prints 80% of the base64Image #30

Open gonzalopaniagua opened 4 years ago

gonzalopaniagua commented 4 years ago

Hello guys,

I achieve to print through base64 but I'm having this issue, when I try to print a base64 image my printer prints only the 80% of the image and then it prints the 20% in the next print.

It's a problem of the printer? Of my code?

I am using the plugin in Ionic.

Here's my image Base64 -> https://pastebin.com/BY45Sa6W

Code that I have in my print.page.ts ->

printImage(){
    this.executing = true;
    this.printBase64().then( result => {
      this.executing = false;
    })
  }

printBase64(): Promise<any>{
    return new Promise((resolve, reject) => {
      BTPrinter.printBase64(function(data){
          console.log("Printed Base64");
          resolve(data)
      },function(err){
          console.log(err);
          reject(err)
      }, this.skere.label, 2)
    })
  }
andreszs commented 3 years ago

I had no problems printing your original, unedited base64 image with the cheapest possible BT printer:

image

Feel free to try my plugin demo app.

image

Maybe you should try reducing the size of the image to use less resources.