Hello, that's my doubt, I've been testing but I haven't found any example.
I am referring to this library.
Thank you.
I am referring to this library.
Thank you.
Can you publish the program code how to send something to the printer?then when you send any text string the printer does nothing
I have the 6th sense that BLE should work on this printer model unless you got the counterfeit one.i assume that ble is not usable with Paperang P1
Have you read the update by Erel about SDK >= 31?
[B4X] BLE 2 - Bluetooth Low Energy
This library replaces the previous BLE library. It is simpler to use and it is more powerful. Its API is based on B4i iBLE library which makes it easy to reuse B4i code. See the iBLE tutorial: https://www.b4x.com/android/forum/threads/ble-bluetooth-low-energy-library.46099/#content Tips &...www.b4x.com
Can you publish the program code how to send something to the printer?
Sub Process_Globals
Dim Printer1 As EscPosPrinter
Dim Version As Double = 2.0 ' Demo program version
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
Activity.AddMenuItem("Connect", "mnuConnect")
Activity.AddMenuItem("Disconnect", "mnuDisconnect")
If FirstTime Then
Printer1.Initialize(Me, "Printer1")
DisableButtons
End If
Activity.Title = Activity.Title & " v" & NumberFormat2(Version, 0, 1, 1, False)
End Sub
Sub Printer1_Connected (Success As Boolean)
If Success Then
ToastMessageShow("Connected successfully", False)
EnableButtons
Else
Msgbox(Printer1.ConnectedErrorMsg, "Error connecting.")
End If
End Sub
Sub btnText_Click
Printer1.Reset
Printer1.WriteString(Printer1.REVERSE)
Printer1.WriteString("Reversed text" & CRLF)
Printer1.WriteString(Printer1.UNREVERSE)
Printer1.WriteString(Printer1.INVERT)
Printer1.WriteString("Normal text £££ " & Chr(99) & CRLF)
Printer1.WriteString(Printer1.UNINVERT)
Printer1.WriteString(Printer1.ULINE1 & "Underline 1 " & Printer1.ULINE2 & "Underline 2 " & Printer1.ULINE0 & "Normal" & CRLF)
Printer1.WriteString("None " & Printer1.BOLD & "Bold " & Printer1.NOBOLD & "None " & CRLF)
Printer1.WriteString("Single " & Printer1.HIGH & "High " & Printer1.WIDE & "Wide " & Printer1.HIGHWIDE & "Both" & Printer1.SINGLE & CRLF)
Printer1.LineSpacing = 15
Printer1.WriteString("Line space half follows" & CRLF)
Printer1.LineSpacing = 45
Printer1.WriteString("Line space one and a half follows" & CRLF)
Printer1.LineSpacing = 60
Printer1.WriteString("Line space two follows" & CRLF)
Printer1.WriteString("Ended" & CRLF)
Printer1.LineSpacing = 20
Printer1.CharacterFont = 0
Printer1.WriteString("Character font = 0, inset line follows" & CRLF)
Printer1.CharacterFont = 1
Printer1.LeftInset = 100
Printer1.WriteString("Character font = 1" & CRLF)
Printer1.WriteString("Character font = 1, inset self-cancelled" & CRLF)
Printer1.LeftMargin = 100
Printer1.WriteString("Character font = 1, left margin set" & CRLF)
Printer1.WriteString("Character font = 1" & CRLF)
Printer1.WriteString("Character font = 1" & CRLF)
Printer1.WriteString(Printer1.DEFAULTS)
Dim tabs() As Int = Array As Int(8,16,24,32)
Printer1.TabPositions = tabs
Printer1.WriteString("The following numbers are tabbed across the line" & CRLF)
Printer1.WriteString("0" & Printer1.HT & "1" & Printer1.HT & "2" & Printer1.HT & "3" & Printer1.HT & "4" & Printer1.HT & CRLF)
Printer1.WriteString("0" & Printer1.HT & "1" & Printer1.HT & "2" & Printer1.HT & "3" & Printer1.HT & "4")
Printer1.PrintAndFeedPaper(0) ' note no CRLF at end of line above
Printer1.WriteString("0" & Printer1.HT & "1" & Printer1.HT & "2" & Printer1.HT & "3" & Printer1.HT & "4" & CRLF)
Printer1.RelativePrintPosn = 120
Printer1.WriteString("First")
Printer1.RelativePrintPosn = 120 ' as dcoumented should push the next text further right but only works at start of line
Printer1.WriteString("Second" & CRLF)
Printer1.WriteString(Printer1.DEFAULTS & CRLF)
Printer1.WriteString("Text ended" & CRLF & CRLF)
End Sub
Sub btnQrCode_Click
' On my printer small QR codes don't seem to be able to be decoded and larger ones look obviously wrong :(
Printer1.Reset
Printer1.HRIfont = 1
Printer1.Justify = 1
Printer1.WriteQRCode(0, "M", 6, "Thanks for using our thermal printer!")
Printer1.WriteQRCode(0, "M", 4, "Thanks for using our thermal printer! Thanks for using our thermal printer! Thanks for using our thermal printer!")
End Sub
The Agraham example is a Bluetooth ESC/POS Printer Class driver and the paperang printer isn't an ESC/POS printer. It has a propriety non-published API whereby several people has reversed engineered the communication between the printer and the app. If I do understand well, first you have to pair the software with the printer, calqulate a custom CRC32, use a maximum packet length, number the packets and use a command number. Quite a bit of try and error work that cannot be developed and tested without a physical printer. And the question is how many people use this printer?
Here you will have to believe me because I also read a lot every day, can't bookmark everything and then have trouble getting anything back later. A typical Dutch disease (just like our Prime Minister has) is called selective memory loss.Where have you read it?