Hello,
I'm trying to integrate a Star TSP650 II.
I can print and I can send the command to cut the paper, thats all working fine.
But when a ticket is printed, the printer always prints a first line with the decimal symbol 0 and I have no idea why it does that.
Does anybody have an idea?
Here below is the routine I use for printing:
Public Sub DirectPrint(aData As String)
BtAdmin.Initialize("BlueTooth")
BTConnection.Initialize("Printer")
Dim PairedDevices As Map
PairedDevices = BTConnection.GetPairedDevices
Dim l As List
Dim DeviceName, MacAddress As String
l.Initialize
For i = 0 To PairedDevices.Size - 1 'Check all devices
l.Add(PairedDevices.GetKeyAt(i))
DeviceName=PairedDevices.Getkeyat(i)
MacAddress=PairedDevices.GetValueAt(i)
Log(DeviceName & " -> " & MacAddress)
If DeviceName.Contains("Star") Then 'Insert the BT-Name of the printer or use the MAC address
Exit
End If
Next
BTConnection.Connect(MacAddress)
Wait For Printer_Connected (Success As Boolean)
If Success Then
Printer.Initialize2(BTConnection.OutputStream,"windows-1252") 'important to print f.e. German/French chars
PrintBuffer= aData
Printer.WriteLine(PrintBuffer)
Printer.Flush
Printer.Close
BTConnection.Disconnect 'disable this if you like
End If
End Sub
I'm trying to integrate a Star TSP650 II.
I can print and I can send the command to cut the paper, thats all working fine.
But when a ticket is printed, the printer always prints a first line with the decimal symbol 0 and I have no idea why it does that.
Does anybody have an idea?
Here below is the routine I use for printing:
Public Sub DirectPrint(aData As String)
BtAdmin.Initialize("BlueTooth")
BTConnection.Initialize("Printer")
Dim PairedDevices As Map
PairedDevices = BTConnection.GetPairedDevices
Dim l As List
Dim DeviceName, MacAddress As String
l.Initialize
For i = 0 To PairedDevices.Size - 1 'Check all devices
l.Add(PairedDevices.GetKeyAt(i))
DeviceName=PairedDevices.Getkeyat(i)
MacAddress=PairedDevices.GetValueAt(i)
Log(DeviceName & " -> " & MacAddress)
If DeviceName.Contains("Star") Then 'Insert the BT-Name of the printer or use the MAC address
Exit
End If
Next
BTConnection.Connect(MacAddress)
Wait For Printer_Connected (Success As Boolean)
If Success Then
Printer.Initialize2(BTConnection.OutputStream,"windows-1252") 'important to print f.e. German/French chars
PrintBuffer= aData
Printer.WriteLine(PrintBuffer)
Printer.Flush
Printer.Close
BTConnection.Disconnect 'disable this if you like
End If
End Sub