| | |
Printing through Print Server
![]() |
•
•
Join Date: Jan 2009
Posts: 2
Reputation:
Solved Threads: 0
I'm trying to write application run as service in vb6.
I have two barcode printers (ZEBRA) with print servers connected to centronics port (D-LINK DP-301P+).
In my service i connect to SQL server and get information about destination printer and source code (ZPL) to print.
Now i must send my ZPL code to the printer.
Everything works fine when I save ZPL to file, map TCP to LPT1 and copy/print FILE to this port like this:
or:
But i don't want to SAVE my ZPL code string to FILE,
i want to connect to my Print Server and Send my ZPL CODE to print.
I Need get some STATUS after operation - success or not - because i have to delete my printed label (or not) from SQL Table.
How to send data to print server? (Winsock.SendData ??)
Do i need Ascii to binary conversion or byte array?
How to check Job status?
Can someone help me?
Tom
I have two barcode printers (ZEBRA) with print servers connected to centronics port (D-LINK DP-301P+).
In my service i connect to SQL server and get information about destination printer and source code (ZPL) to print.
Now i must send my ZPL code to the printer.
Everything works fine when I save ZPL to file, map TCP to LPT1 and copy/print FILE to this port like this:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
net use LPT1: \\100.0.0.1\myport1 copy C:\test1.txt lpt1: /b
or:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
objNetwork.AddPrinterConnection("LPT1:", "\\100.0.0.1\myport1", True) ... Open "C:\test1.txt" For Binary As #1 Open "LPT1:" For Binary As #2 ...
But i don't want to SAVE my ZPL code string to FILE,
i want to connect to my Print Server and Send my ZPL CODE to print.
I Need get some STATUS after operation - success or not - because i have to delete my printed label (or not) from SQL Table.
How to send data to print server? (Winsock.SendData ??)
Do i need Ascii to binary conversion or byte array?
How to check Job status?
Can someone help me?
Tom
Hmmm, I think the mscomm control handles both serial and parallel communications... but seeing that this is a network printer, and you are mapping it, it complicates things some. If the second code that you posted works (ie: using Open "c:\test1.txt" for Binary as #1) then why not simply save the code that you write to the file into like, a byte array (instead of the hard-drive), and then open LPT1 like you do, and just write the array in a loop or such to the printer. When you are done sending the data, just redim the byte array, and redim it again for a new ZPL.
•
•
Join Date: Jan 2009
Posts: 2
Reputation:
Solved Threads: 0
•
•
•
•
Hmmm, I think the mscomm control handles both serial and parallel communications... but seeing that this is a network printer, and you are mapping it, it complicates things some. If the second code that you posted works (ie: using Open "c:\test1.txt" for Binary as #1) then why not simply save the code that you write to the file into like, a byte array (instead of the hard-drive), and then open LPT1 like you do, and just write the array in a loop or such to the printer. When you are done sending the data, just redim the byte array, and redim it again for a new ZPL.
![]() |
Similar Threads
- Using VB Code - Silent download pdf from server and print to local printer (Visual Basic 4 / 5 / 6)
- How can I switch from direct USB printing to print server in Mac OS X? (OS X)
- Trying to print to HP 5150 using Linksys Print Server (Apple Hardware)
- Printing over Samba (OS X)
- No page header and footer when printing a web page (JavaScript / DHTML / AJAX)
- Print Server / VPN (Networking Hardware Configuration)
- wireless printing (Networking Hardware Configuration)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Sending Data from vb6 to post
- Next Thread: showing record on the report
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






