-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Printing base64 data in Android crashes app #272
Comments
same here... |
I have the same problem. Do you have a solution? |
I used this plugin instead.... cordova-print-pdf-plugin Far less features but it works for what I need |
This is not an issue related to the plugin but how base64 is handled in general. There is usually a limit on how many bytes of base64 is stored. This might be why on other platforms / smaller image sizes its fine. |
One alternative you can do is try saving the base64 string to a file and then try to pass path of the file to this print function. This has worked for me. You would need cordova-plugin-file. |
@pradipchitrakar |
You would need to convert base64 string to blob and pass it to this.file.writeFile. `b64toBlob(b64Data: string, contentType: string, sliceSize?: number) {
}` |
not work for me. |
I'm having the same issue. Looking into No solution yet, but it's possible we have to encode MIME type into the base64 in case that didn't happen during conversion to base64. |
@martinneumann good spot, i ran into the same issue and fixed it the same way. seems like base64 PDF support isn't actually implemented. so i modified the function allowing you to pass an optional MIME type manually. i would like to pull this via npm though instead of needing to keep a modified cordova plugin in my repo... |
I am trying to print baes64 data on Android. On iOS, it functions perfectly. On Android, when I try to call the plugin to print, my app crashes. This has happened on all Android phones I have tested with. Has anybody else seen this? Any solutions?
The text was updated successfully, but these errors were encountered: