B4X:
Sub PrinterSerial_Connected(Success As Boolean)
If Success Then
SendTextToPrinter
EndIf
End Sub
Sub SendTextToPrinter
If printer_AStream.IsInitialized = False Then
printer_AStream.Initialize(printer_serial1.InputStream,printer_serial1.OutputStream,"PrinterAStream")
End If
Dim InputFile As InputStream=File.OpenInput(File.DirAssets, "sample3.prn")
Dim buffer() As Byte
InputFile.ReadBytes(buffer,0,InputFile.BytesAvailable)
printer_astream.write(buffer)
end sub
Last edited: