Hi. I made a wrapper for printing to Star Printers in raster mode (USB and Network) which works. I then decided to integrate to this wrapper the ePos SDK which compiles OK in eclipse and compiles OK in B4A. But when I try to use the EpsonPrinter type it errors in the declaration of the variable.
Attached is the code for the wrapper (epson only).
And this is the code for B4A:
Variable target should be: "TCP:127.0.0.1" or "USB:/dev/udev/xxxxxxxxxx".
It errors on "Dim epson As EpsonPrinter"
What am I missing?
Any help is appreciated.
Edit: Forgot to include the jar I'm using from Epson.
ePOS_SDK_Android_v2.3.0
- ePOS2.jar
And the error is that "cannot find java class "prusb.wrapper.eposprint.EpsonPrinter".
Another thing. I had to use try/catch in eclipse because if I used "throws EPos2Exception", B4A errors at "cannot connect to EPos2Exception".
Also I declared the Initialize method with BA ba as the 3rd parameter but in B4A only shows 2 parameters.
Attached is the code for the wrapper (epson only).
And this is the code for B4A:
B4X:
Sub PrintEpsonDocument(tar As String)
Try
Dim epson As EpsonPrinter
epson.Initialize(epson.TM_T20, epson.MODEL_ANK)
epson.connect(tar, 10000)
For i = 0 To PrintBuffer.Size - 1
epson.addTextFont(epson.FONT_B)
epson.addText(PrintBuffer.Get(i))
Next
If CASH_DRAWER_CODE <> "" Then
epson.addPulse(0, 0)
End If
If PRINTER_CUT_CODE <> "" Then
epson.addCut(0)
End If
epson.sendData(epson.PARAM_DEFAULT)
Catch
Msgbox2(LastException.Message, "Error", "OK", "", "", LoadBitmap(File.DirAssets, "error.jpg"))
End Try
End Sub
Variable target should be: "TCP:127.0.0.1" or "USB:/dev/udev/xxxxxxxxxx".
It errors on "Dim epson As EpsonPrinter"
What am I missing?
Any help is appreciated.
Edit: Forgot to include the jar I'm using from Epson.
ePOS_SDK_Android_v2.3.0
- ePOS2.jar
And the error is that "cannot find java class "prusb.wrapper.eposprint.EpsonPrinter".
Another thing. I had to use try/catch in eclipse because if I used "throws EPos2Exception", B4A errors at "cannot connect to EPos2Exception".
Also I declared the Initialize method with BA ba as the 3rd parameter but in B4A only shows 2 parameters.
Attachments
Last edited: