Open EnriqueV opened 7 years ago
You are passing a div, it is certainly not a valid base64 image, just pass the image printParam.logo I hope I have helped
hi, i'm trying printParam.logowith print method, but i have this error: Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference
You have to pass the converted image to base64, without any tags like div, img or others. Use only the parameter you say is a base64 string. The print function you're using, this @EnriqueV will never print. @asiddeen and @EnriqueV here is an example of the function that I am printing the image and the debugged text. Pastebin
i have this image string "data:image/png;base64,iVBORw0KGgoA..." what must i send to print image?
i tried passing whole code, no success i tried passing "iVBORw0KGgo...", no success
i get no error form my console log, but print output not quite what i wanted it just print random special character
Hi @alfiaqil Verify that string is a correct base64 encode, in my case I solve this problem convert string base64 to image file in java code try this:
BitmapFactory.Options options = new BitmapFactory.Options(); options.inScaled = true; int x =0; int y = 0; Bitmap bm = BitmapFactory.decodeFile("file path", options); int width= bm.getWidth(); int height= bm.getHeight(); Bitmap newBitmap= Bitmap.createScaledBitmap(bm,625,height,true);
Hi I have this error: Error Print! bad base-64 I use that print image method in this plugin, this is my code: function printerDocument(printParam) {
printParam.logo is a base64 image