Comments (13)
Here is my case
code:
val printer = EscPosPrinter(
BluetoothPrintersConnections.selectFirstPaired(), 603, 70f, 46,
EscPosCharsetEncoding("cp866", 17)
)
fun printS(sticker: Sticker) {
val day = sticker.day
val saleData = sticker.saleDate
val docNumber = sticker.documentNumber
val conNameFirst = sticker.contractorName.chunked(sticker.contractorName.length/2)[0]
val conNameSecond = sticker.contractorName.chunked(sticker.contractorName.length/2)[1]
val direction = sticker.direction
val warehouseNum = sticker.warehouseNum
printer
.printFormattedText(
"[C]<font size='medium'> | $day |$saleData |</font>" +
"<font size='wide'>$docNumber</font>\n" +
"[L]|\n" +
"[C]<font size='medium'>| $conNameFirst |</font>\n" +
"[C]<font size='medium'><u>| $conNameSecond |</u></font>\n" +
"[L]|\n" +
"[C]<font size='medium'><u>| $direction |</u></font>\n" +
"[C]<font size='medium'><u>| $warehouseNum |</u></font>",
122
)
}
And here is how it printing
https://streamable.com/zo3sdj
from escpos-thermalprinter-android.
I think it's 42 characters by line not 46.
Your printer seems to not have a good line heigth for this stickers. Are they compatible ?
from escpos-thermalprinter-android.
I think it's 42 characters by line not 46.
Also tried, didn't work
Your printer seems to not have a good line heigth for this stickers. Are they compatible ?
Yep, he understands about sticker height and also may skip them 1 by 1, but seems the library doesn't understand how to skip them correctly when printed. So I sow code printer.cutPaper()
inside EscPosPrinter but it's don't work also because methods printFormattedText
and printFormattedTextAndCut
works equals for me. Very strange(
from escpos-thermalprinter-android.
Ok I have may be a solution. I will send you tomorrow.
from escpos-thermalprinter-android.
@DantSu That would be very cool, I would be very grateful. I can shoot a video of how it works now if you run it, if it helps
from escpos-thermalprinter-android.
please use the last version v2.0.5.
printFormattedText(String text, int dotsFeedPaper)
dotsFeedPaper
will allow you to feed paper with dot precision (depending of your printer dpi). Accepted value 0 to 255.
from escpos-thermalprinter-android.
@DantSu Thank you very much, I did not expect it to work at all !! How can I thank you?) You are using the "buy me a coffee" service?
from escpos-thermalprinter-android.
Do you have a picture of the final printing ?
You already star the repo, it's enought ;)
from escpos-thermalprinter-android.
@DantSu I would like to support the project in some other way. Yes here is the picture
from escpos-thermalprinter-android.
Ho yeah ! Great ! That solve the problem.
To support the project : Test the library, report bugs, create PR.
I just wan't to do the most universal Android library for ESC/POS printer. For now, it's not perfect but each issue and PR help me to be closest. ;)
from escpos-thermalprinter-android.
@DantSu Ok, then I'll send you end version with screenshot and code, maybe it's helping someone )))
from escpos-thermalprinter-android.
Yes, that will be perfect :)
from escpos-thermalprinter-android.
Nice ! thx for sharing
from escpos-thermalprinter-android.
Related Issues (20)
- Printing Issues in STAR Printer MCP30 HOT 1
- Letter "r" is coming at the start of print HOT 3
- I can't print multiple times HOT 2
- After update compileSdkVersion and targetSdkVersion to 34 USB crash HOT 2
- Print from multiple devices at the same time HOT 2
- Can't print with android pos with built-in printer HOT 2
- is there any callback from printer instance or others end which can return printed successfully or not? HOT 1
- Indian language tamil font is not printing HOT 5
- Double line spacing issue on Bixolon SRP-275IIIC Print
- Update the Readme file
- Blocked PAX A920 PRO
- Unexpected behavior when printing more than one time in sequence
- Can't print arabic on SUNMI Devices HOT 1
- How i can change the font size with my own prefer size?
- buzzer integrated HOT 2
- Crashing with broadcast com.android.example.USB_PERMISSION HOT 3
- SUNMI "r" problem with a lots of test and extra infos HOT 1
- Implement Printer Error Validation and Paper Roll Status Check
- Can´t print in DATECS DPP-350
- update SDK Version to 34 and using android 14 USB crash HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from escpos-thermalprinter-android.