Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TCP/IP Printing
#1
Code: (Select All)
Sub TCPPrint (IP As String, Port As String, toPrint As String)
    CRLF$ = Chr$(10) + Chr$(13)
    x = _OpenClient("TCP/IP:" + Port + ":" + IP)
    toPrint = toPrint + CRLF$
    Put #x, , CRFF$
End Sub

Sub TCPEndPrint (IP As String, Port As String)
    CRFF$ = Chr$(10) + Chr$(12)
    x = _OpenClient("TCP/IP:" + Port + ":" + IP)
    Put #x, , CRFF$
End Sub
Utility for Sending raw text to a network printer via TCP/IP

Use the first sub to send the data, then when finished send the second sub and it will initiate the form feed and spit the sheet out.
Reply
#2
Nice thing, but sadly I got only a white sheet. And yes, there's enough ink in the printer. It's a Brother HL-3142CW @ Port 9100.

Edit: OK, I changed line 5 to Put #x,,toPrint. Same effect as before.
"Give a man a program and he will be happy for a day. Teach him to program and he will be happy for the rest of his life."
Reply
#3
(05-22-2022, 08:21 AM)CletusSnow Wrote: Nice thing, but sadly I got only a white sheet. And yes, there's enough ink in the printer. It's a Brother HL-3142CW @ Port 9100.

Edit: OK, I changed line 5 to Put #x,,toPrint. Same effect as before.

I'm not sure if this is compatible with a laser printer due to the way they print.  The program uses ESC/P codes to print.
Reply




Users browsing this thread: 1 Guest(s)