Hello Timwill, first of all: thanks for the example project, I can confim it works with Xperia Arc and noname bluetooth printer i got from eBay (I can post link, but you can see the model from the pictures attached).
I have a problem printing Latin2 extended characters. I got from wikipedia (
https://en.wikipedia.org/wiki/ISO/IEC_8859-2) decimal codes for these extended characters and I try sending them to the printer, but I get some unwanted characters.
I have modified your code like this:
Sub Globals
'Dim TogglA As Toggle
Dim txt1 As EditText
Dim btn1 As Button
Dim lbl1 As Label
Dim lst1 As ListView
End Sub
Sub Activity_Create(FirstTime As Boolean)
txt1.Initialize("txt1")
btn1.Initialize("btn1")
lbl1.Initialize("")
lst1.Initialize("lst1")
For i=30 To 900
lst1.AddTwoLines2(Chr(i),i,i)
Next
lbl1.TextSize=22
btn1.Text="print"
txt1.InputType=txt1.INPUT_TYPE_PHONE
Activity.AddView(lbl1,0,0,100%x,60dip)
Activity.AddView(txt1,0,60dip,100%x,60dip)
Activity.AddView(btn1,0,120dip,100%x,60dip)
Activity.AddView(lst1,0,180dip,100%x,100%y-240dip)
If FirstTime Then
btAdmin.Initialize("BlueTeeth")
cmp20.Initialize("Printer")
End If
'StartPrinter
End Sub
...and added some new code:
Sub txt1_TextChanged (Old As String, New As String)
If New<>"" Then
lbl1.Text=Chr(New)
End If
End Sub
Sub btn1_click
PrintBuffer="ASCII (" & txt1.Text & "):" & Chr(txt1.Text) & CRLF
'PrintBuffer=PrintBuffer & "StringGetBytes (šđčćž):" & "šđčćž".GetBytes("UTF8")
StartPrinter
End Sub
Sub lst1_ItemClick (Position As Int, Value As Object)
txt1.Text=Value
End Sub
This way I see all ASCII codes from 30 to 900 and when I select code 208 (see image "screenshot") I see the character displaying as I want it in the app. This character I can see in the test page printed by the printer (see image "testpage") and I am sure I have set the printer to the correct codepage (see image "settings").
When I click "Print" button, the printer prints out what is in image "print".
Can you or someone point me in the right direction here?
I don't know how to send these extended characters to the printer, and I am sure the printer can print these characters (as seen in image "testpage").