Closed vijayvaghela72 closed 7 months ago
bluetooth.isConnected;
// Convert the QR code Uint8List to a base64-encoded bitmap
await bluetooth.printCustom("Diesel QR Code", 50, 50);
await bluetooth.printCustom("------------------------", 50, 50);
await bluetooth.printNewLine();
await bluetooth.printCustom("Date : $date", 50, 50);
await bluetooth.printNewLine();
await bluetooth.printCustom("Trip No. : $tripNo", 50, 50);
await bluetooth.printNewLine();
await bluetooth.printCustom("------------------------", 50, 50);
await bluetooth.printNewLine();
await bluetooth.printQRcode(jsonEncode(qrDataString), 250, 250, 1);
await bluetooth.printNewLine();
await bluetooth.printCustom("------------------------", 50, 50);
await bluetooth.printCustom("Powered by AeonX Digital", 50, 50);
// code for print a data to printer
await bluetooth.printNewLine();
await bluetooth.printNewLine();
await bluetooth.printNewLine();
// Print another blank line (space)
await bluetooth.printNewLine();
await bluetooth.paperCut();
this is my code
await bluetooth.printQRcode(jsonEncode(qrDataString), 250, 250, 1);
i have added side of 250 * 250
but when string to large then it's print small QR as i share in photo .
please provide me solution for this .
when data is large it's print small QR and QR is not scannable .🥲
Hello team!
please provide help on issue,
@juliocbcotta , @maurovanetti , @mvanvu , @ricardochen , @kakzaki , @ziakhan110 @ziakhan110 @flutter-painter @hmtuan196 @wmattei @tauqeerkhattak @knight-dev
need your help !
Thank You in advance 🙂!
Please provide this data example so it can be reproduced. What does the json look like if you put it in a dedicated object ?
final jsonEncoded = jsonEncode(qrDataString);
How do you build this QR ?
this is my
String qrDataString = "{"T_no":"1699245740","T_date":"06/11/2023","supervisor":"Super Admin","sending_p":"21","sending_p_D":"[GB01] - BOFFA - MINING (GB01)","receving_p":"25","receving_p_D":"[GB05] - KOKAYA - PORT (GB05)","material":"14","material_D":"[11006091] - RB LUMPS 90-120 MM","remarks":"okay","vehical_N":"5","vehical_D":"GJ01BV3021","mining_C_ID":"30","mining_C_D":"TREMPE TRANSPORT","vehical_TW":"null","vehical_C":"100"}"
if similaly i am passing large data in this map variable ,
like this ,
{"T_no":"1699246062","T_date":"06/11/2023","supervisor":"Super Admin","sending_p":"22","sending_p_D":"[GB03] - BOFFA - MINING (GB03)","receving_p":"23","receving_p_D":"[GB02] - KOKAYA - PORT (GB02)","material":"14","material_D":"[11006091] - RB LUMPS 90-120 MM","remarks":"dikfifififidjs5djdtfofhzysigkx namaste namaste ndifjdidudixyfozyfuaogydpdyfodoamaste ","vehical_N":"5","vehical_D":"GJ01BV3021","mining_C_ID":"30","mining_C_D":"TREMPE TRANSPORT","vehical_TW":"null","vehical_C":"100"}
the getting small QR
there is to much size difference in both QR .
@flutter-painter
simplay if data is large means string length is large then small QR code , if string length is small QR code size is large .
therefore small QR is difficult to scan .please help me
@flutter-painter
Hi Vijay,
Thank you for providing more context. Since this seems an urgent issue could you consider the two following workarounds ?
Setting a maximum length to your text fields son that qr code stays below the ceiling.
Making a 2nd qr code if the first one will not be able to contain all info.
This is only to buy you time to dig deeper in the qr making process. Anyhow you will need a string max length since qr can only contain à certain amount of info and the wider they are the harder it is to scan.
Thank you for instance reply ,
when i am trying increase this width and height value to more than 250 it's not print anything ,
await bluetooth.printQRcode(jsonEncode(qrDataString), 250, 250, 1);
2 different QR not possible in my case i have to maintain every thing in one single QR but main issue is when data increase then QR size is decrease. if in slip there is enough size to expand but it's not working getting small QR code .
how can i increase size of QR . is it possible ?
Everything is possible as long as you put in the efforts.
The Java bit that handles qr creation is in
android/src/main/java/id/kakzaki/blue_thermal_printer/BlueThermalPrinterPlugin.java
It seems to be
BitMatrix bitMatrix = multiFormatWriter.encode(textToQR, BarcodeFormat.QR_CODE, width, height); BarcodeEncoder barcodeEncoder = new BarcodeEncoder(); Bitmap bmp = barcodeEncoder.createBitmap(bitMatrix);
Which gives no clue about qr code Size. Note the height and width settings are just wrappers added by hmtuan196. I dont think they will help you.
Though you will need to setup a max length for your strings, I understand that the experienced threshold is not acceptable for you.
Here are two options I See :
You may want to delete qr code after printing You might be able to print images from memory instead of handling needed persistence.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.