-
Notifications
You must be signed in to change notification settings - Fork 73
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
[iOS] Issue about content of receipt too long #68
Comments
@KimGiay , how to print on iOS? I used example and build on iOS 14, ip7 but could not print. And what is your printer? |
@KimGiay, |
This actually happens to me too on iOS, but not on Android. blue_print_pos:
git:
url: https://github.com/iandis/blue_print_pos
ref: 0.0.17 Any helps are appreciated🙂 |
Hi @iandis, Thanks for your share! I guess the issue's root cause may be associated with WebKit's framework of iOS. Could I have your environment's information that worked successfully? (such as Bluetooth printer name, iPhone's model) Have a nice day! Note: This is a receive which I printed with your forked version. |
@KimGiay , I mixed this library and bluetooth_print. This is result: |
Uhm... I am guessing the receive was printed by an Android device? anw, Do you find a solution for print Vietnamese content? |
I found out that on iOS, when the Edit: |
@iandis,
The receipt's content is more than 2000 height, which is a normal case with end users. Let me know if I can help anything to contribute for resolve this issue. |
Hi @KimGiay, I can only think of chunking the receipt into a few |
Hi @iandis , Thanks you so much! Unfortunately, It worked not well with my case. |
Hi @KimGiay v0.0.21 should solve that problem. Note that you must choose between manually splitting the |
Hi @iandis , Thank you so much for your effort! |
Hi @iandis , Today I tried to print on the device that has an inner printer. But I had another issue when I used this lib. |
@iandis hello , is it possible to add in barcode into your forked version? Thank you.. |
on Android, my solution is need to change the offestHeight by using local package. You can replace the specific height in line 92 in BluePrintPosPlugin.kt if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
webView.evaluateJavascript("document.body.offsetWidth") { offsetWidth ->
webView.evaluateJavascript("document.body.offsetHeight") { offsetHeight ->
var offsetHeight2: Double
offsetHeight2 = offsetHeight.toDouble() - 180 // px, Change this
Logger.log("\noffsetWidth : $offsetWidth")
Logger.log("\noffsetHeight : $offsetHeight2")
if (offsetWidth != null && offsetWidth.isNotEmpty() && offsetHeight != null && offsetHeight.isNotEmpty()) {
val data = webView.toBitmap(
offsetWidth.toDouble(),
offsetHeight2
)
if (data != null) {
val bytes = data.toByteArray()
result.success(bytes)
Logger.log("\n Got snapshot")
}
}
}
}
} This happen causes the webView snapshot is not accurated the height of html content |
@RasyidMF the solution was not working in my case. What is the POS model which you are using? |
hello everyone, I'm currently still working on issue happening on iOS such as this and this. The issue might come from the fact that iOS uses BLE to transfer bytes to the printer device. After some readings I found out that the buffer limit of transferring bytes via BLE might be the issue. So I'm currently trying to use proper CoreBluetooth API on iOS to send bytes. Thanks. |
Hi @iandis, I'm so happy when heard that! Best regards, |
please move to my PR here for further discussions |
Hello author,
Thank you so much for your sharing!
Your library is working so well but I found a new issue with the content being too long.
My environment: iPhone 8+, iOS15.
It works well with the receipt has content's height under 2000.
But when the receipt content's height than 2000, it has printed a part of the receipt but not full.
I took a note below:
![IMG_7785](https://user-images.githubusercontent.com/11257732/177976150-6c3919b6-88c0-4c05-b35a-b4c4dca5749d.png)
The receipt content's sizes have been worked.
height = 1965.0
width = 576.0
and:
height = 2000.0
width = 576.0
The result is like that:
Below is the sizes were not working.
![IMG_7784](https://user-images.githubusercontent.com/11257732/177976376-e0cef548-d787-4547-a680-06d7ee3f0a03.png)
height = 2133.0
width = 576.0
and
height = 2455.0
width = 576.0
The text was updated successfully, but these errors were encountered: