|
|
|
|
|
Author:
|
ptaylor
|
|
Views:
|
876
|
|
|
Print RAW data to Network Printers
|
|
|
Send prints to a Network printer
Originally designed to send ZPL commands to Zebra S4M using an HP Jet Direct this code will send RAW print jobs to and network printer, Including Dot-Matrix and Thermal Transfer Printers
|
|
|
|
|
Dim strPrintData as String Dim DataBytes() As Byte Dim PrintedStream As NetworkStream Dim HostIPAddress As System.Net.IPAddress Dim PrinterPort As New System.Net.Sockets.TcpClient Try If Me.strPrintData IsNot Nothing Then DataBytes = System.Text.Encoding.ASCII.GetBytes(Me.strPrintData) If Not PrinterPort.Client.Connected Then PrinterPort.Connect(HostIPAddress, 9100) End If PrintedStream = PrinterPort.GetStream If PrintedStream.CanWrite Then PrintedStream.Write(DataBytes, 0, DataBytes.Length) End If PrintedStream.Close() PrinterPort.Close() End If Catch ex As Exception Throw New Exception(ex.Message) End Try
|
|
|
|
|
|
Date Added:
06/04/2009 20:31:38
|
|
|
|
|
|
|
Your Details: Not Logged In
Join Date: N/A
Last Logon: N/A
Code Snippets: N/A
Code Comments:
Forum Posts: N/A
Forum Subjects: N/A
Site Wide
Code Snippets: 32
Code Comments:
Forum Posts: 52
Forum Subjects: 24
|
|
|
|
|
|
|
|
|
|
|