B4A Class Bluetooth ESC/POS Printer Class

Ertan

Active Member
Licensed User
B4X:
    Printer1.WriteString("İrem" & CRLF)    'CRLF is actually only LF
    Printer1.WriteString("İrem" & Chr(13) & Chr(10))    'CR = ASCII 13, LF = ASCII 10
rem writes as. The letter "İ"does not appear.
 

Ertan

Active Member
Licensed User

I get results this way.

I noticed something.

When selecting PC857 from the printer's settings and printing all the letters, Turkish letters are printed.

------------------------------------------------------------------------------------------------------------

However, there are no Turkish letters when the Charset is printed on the B4A Bluetooth Printer project.
There is no letter here.
 

Ertan

Active Member
Licensed User
Righto, so that tells us:
- CR/LF is not automatically added
- LF will move to start of next line
- CR does nothing

which aligns with that the class code seems to do.

Yikes, you have good eyes!
SOLVED!

B4X:
Printer1.WriteString2("Türkçe Yazı" & CRLF, "IBM857")
You can print Turkish characters with this code.
IBM857 It is important.
 

Tico.13

Member
Hi @agraham, how can i establish the barcode width, i have try taking out the comment of 'Printer1.BarCodeWidth = 4 and setting a number but i havent get it to work, thanks in advance an best regards
 

agraham

Expert
Licensed User
Longtime User
It's already implemented in the ESCPOSPrinter class
B4X:
' Set the line content justification, must be the first item on a new line
' 0 left, 1 centre, 2 right
Public Sub setJustify(justify As Int)
    WriteString(ESC & "a" & Chr(justify + 48))
End S
 

TILogistic

Expert
Licensed User
Longtime User
ESC a

[Name]
Select justification
[Format]
ASCII ESC a n
Hex1B61n
Decimal2797n
[Range]
n = 0 – 2, 48 – 50
[Default]
n = 0
[Description]
In Standard mode, aligns all the data in one line to the selected layout, using n as follows:
nJustification
0, 48Left justification
1, 49Centered
2, 50Right justification
 
[QUOTE = "agraham, pos: 785087, anggota: 448"]
Ini sudah diterapkan di kelas ESCPOSPrinter
[CODE = b4x] 'Setel justifikasi konten baris, harus menjadi item pertama di baris baru
'0 kiri, 1 tengah, 2 kanan
Public Sub setJustify (justify As Int)
WriteString (ESC & "a" & Chr (rata + 48))
Akhiri S [/ CODE]
[/QUOTE]
terima kasih @agraham. ini sangat membantu saya
 

Tico.13

Member
Hi @agraham ! hope you are fine! How does the printbuffer works? im trying to print in labels paper but after sending to print 3 labels(paper) my printer starts to jumps spaces and print outside the paper or there is a way to set paper size or the gap between labels?
 

Joel R

New Member
I had only 1 problem about this printer module regarding on barcode 39 extra character on last digit..
anyone can solve about my problem?
 

agraham

Expert
Licensed User
Longtime User
my printer starts to jumps spaces and print outside the pape
on barcode 39 extra character on last digit..
All these cheap Chinese thermal printers seem buggy in one way or another so you will just have to play with it yourself and see if you can find something that works for you.
 

Urishev

Member
Licensed User
Longtime User
Thank you Mr. Agraham for the wonderful Bluetooth Printer Class.
There are no lines in your example. Does your class support line drawing?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…