B4A Library SD: BT Printer Bluetooth

Star-Dust

Expert
Licensed User
Longtime User
Hello is there any improvement?
After doing a search I found how to print the characters of different sets. I attach the example of Chinese:

Initialize the printer with this encoding
B4X:
Printer.Initialize(Me,"Printer","GB2312")

Precede the Chinese text with chr (27) + chr(64)
B4X:
Printer.AddBuffer_WriteLine(Chr(27) & Chr(64) & "艾德蒙 AOC E2450SWH 23.6吋")

see this link
 

Ertan

Active Member
Licensed User


Hello, I am having this problem too. It doesn't print all Turkish characters. Only ( Ç , ü , Ö , Ü ) printing these characters.
I want to write in the first line ( Çilek , Ördek , Ağaç ) but does not print ( Ç Ö ğ)
"Ş, İ, Ö, Ç, Ü, Ğ, ş, ı, ö, ç, ü, ğ" I want to print these letters. I've been researching for this for a few months but I couldn't figure it out.

Can you help me to solve this event?

B4X:
Printer.Initialize(Me,"Printer","iso-8859-9")
 
Last edited:

Ertan

Active Member
Licensed User


I choose Turkish option in the settings section of this application. It's using TrueTpye font.
The printer prints these characters. How can we activate this event in the library?
 

Star-Dust

Expert
Licensed User
Longtime User
Hi @Ertan ,
The problem is probably related to your printer. I did the tests with mine and here are the results

B4X:
Printer.Initialize(Me,"Printer","GB2312")

B4X:
Printer.ClearBuffer
    Printer.AddBuffer_Writeline(ESC_POS.BoldOn & "Hallo dear" & ESC_POS.DoubleOff)
    Printer.AddBuffer_Writeline("How are you?")
    Printer.AddBuffer_Writeline("Fine thank's")
 
    Printer.AddBuffer_WriteLine("打印中文")
    Printer.AddBuffer_WriteLine("艾德蒙 AOC E2450SWH 23.6吋")


PS: Chinese = "GB18030"; Turkish = "GB2312"

 
Last edited:

asales

Expert
Licensed User
Longtime User
I am trying you lib, but I get this missing properties in the demo:
Unknown member: flushAllAndClose
Unknown member: Preview.Height, Panel.Height

 

Star-Dust

Expert
Licensed User
Longtime User
Hi, How can print Greek Characters ?
It all depends on whether the printer contains this character set.
If the manual supports it, you must select the CODCE PAGE to activate the chosen character set
 

Ertan

Active Member
Licensed User
I tested it for a project today and it worked.
The problem is all about the character set of the printer.
if you too " ğ, Ğ, ş, Ş, ı, İ , ü, Ü, ö, Ö, ç, Ç " you want to print letters;
B4X:
Printer.Initialize(Me,"Printer","IBM857")
You should use IBM857.
Remember, if your printer still doesn't print these characters, you should correct this in your printer settings.
 

Star-Dust

Expert
Licensed User
Longtime User
Update Rel.0.18
  • Add event: DataReceived(Buffer() As Byte)
  • Add new ESC_POS command: QueryPrinterStatus, QueryOfflineCauses, QueryErrorCauses, QueryPaperStatus
 
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
Hi:

DataReceved() is use in which cases???

Thanks!
Some printers if you send certain commands tell you the status of the printer or if it is out of paper or other errors
 

Tico.13

Member
Is there a way to set paper size, my app works fine but if i send to print more than 2 labels(paper) it starts to jump spaces
 

Star-Dust

Expert
Licensed User
Longtime User
Each label sends to the printer. It could be a buffer problem
 

Star-Dust

Expert
Licensed User
Longtime User
How to center a writeline?
See this post

or use CenterJustify method
 

Bob Spielen

Active Member
Licensed User
To speed up processing I just placed the command: Printer.SelectFromMac("00:08:1B:95:42:BD") in B4A and the flow goes to Printer_ConnectedToPrint (Success As Boolean) as true.

1. In B4J (Printer.SelectFromMac("00081B9542BD")) it doesn't work, I have to search first. Is it possible to connect directly without have to search the device?
2. Is it possible to keep printing from both devices -Mobile and PC? . Do I have to logout the printer with "close" and search the printer again when I change the sender?

Tks a lot for the reply
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…