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