B4A Library SD: BT Printer Bluetooth

aviario

Active Member
Licensed User
Longtime User
Hello, I tested your library with an Intermec Pr3 printer and it does not print the bitmap

Thank
 

Star-Dust

Expert
Licensed User
Longtime User
There are 2 methods of printing. The former is compatible with most printers. The second with some models.

Try both. There is a third method, but I still have to experiment with it, and it is not included in the library
 

Star-Dust

Expert
Licensed User
Longtime User
I'm sorry. On the forum you will find many similar libraries for Bluetooth, try them and see the compatible one for your printer.
 

rkmoray

Active Member
Licensed User
Longtime User
I am trying you lib on a bt printer,but cannot figure out how to cut the paper after the printing is complete
 

Star-Dust

Expert
Licensed User
Longtime User
I am trying you lib on a bt printer,but cannot figure out how to cut the paper after the printing is complete
You need to know the command for cutting the paper. I do not know if it is the same for all printers
 

rkmoray

Active Member
Licensed User
Longtime User
According to the document for the printer,
"• Paper cut by GS V m n."

but I do not know how to convert that to run with your library.
 

Star-Dust

Expert
Licensed User
Longtime User
According to the document for the printer,
"• Paper cut by GS V m n."

but I do not know how to convert that to run with your library.
Tomorrow I'll take a look and let you know
 

Star-Dust

Expert
Licensed User
Longtime User
try this
B4X:
PrinterBT.AddBuffer_ArrayByte(Array As Byte(29,86,0,48))
or
B4X:
Dim N as int = 10 ' n × vertical motion unit
PrinterBT.AddBuffer_ArrayByte(Array As Byte(29,86,65,n))
 
Last edited:

rkmoray

Active Member
Licensed User
Longtime User
Thank you for the conversion. Unfortunately neither of them cut the paper as needed.
Any other ideas would be appreciated
 

Star-Dust

Expert
Licensed User
Longtime User
Try adding a zero after the command

PrinterBT.AddBuffer_ArrayByte(Array As Byte(29,86,0,48,0))
 

rkmoray

Active Member
Licensed User
Longtime User
So there is no misunderstanding, this is what my code is, and it still does not cut the paper.

B4X:
Stampa.Initialize(Me,"Stampa",Encoding.Windows1252)
Stampa.AddBuffer_Writeline("How are you?")
Stampa.AddBuffer_ArrayByte(Array As Byte(29,86,0,48,0))
Stampa.SendAllAndClose
 

Star-Dust

Expert
Licensed User
Longtime User
GS V m n
29=GS, 86 = V, m=56, n= (any number)
 

rkmoray

Active Member
Licensed User
Longtime User
I changed the arraybyte to read
Stampa.AddBuffer_ArrayByte(Array As Byte(29,86,56,10))
but it still does not cut.
 

Star-Dust

Expert
Licensed User
Longtime User
You need to find the right code for your printer, and sometimes the commands close with zero
 

Star-Dust

Expert
Licensed User
Longtime User
Is right,but no space. N = vertical motion

B4X:
Dim N as int = 10 ' n × vertical motion unit
PrinterBT.AddBuffer_ArrayByte(Array As Byte(29,86,65,n))
 
Last edited:

rkmoray

Active Member
Licensed User
Longtime User
I appreciate all the help you are giving me,and if this ever completely works, there is a pot of coffee ion it for you, not just a cup.

I have the line
B4X:
        PrintBuffer=ESC_POS.BoldOn  & ESC_POS.FontA_Bold &  ESC_JUSTIFY_LEFT & TicketCatName   & ESC_JUSTIFY_RIGHT & SellingPrice
        Starter.Printer.WriteLine(PrintBuffer)

What I am trying to do is have the first variable (TicketCatName ) on the left justified and the second variable(SellingPrice) Right justified

But what I get is basically both variables printer as if it were concatenated.
 

vecino

Well-Known Member
Licensed User
Longtime User
Hi, I am testing your library and I see that there is no example Send_Buffer_to_Print_flush.
It's a mistake?
Regards.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…