Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Zebra printer printing

Status
Not open for further replies.

Sillygirl

Programmer
May 3, 2002
80
US
I am converting code from IGP to ZPL and I wanted to know if anyone had any kind of code samples for me to look at.

Here is an excerpt of what was coded in VB to a printronix printer. What would it be like in ZPL?

Printer.Print "^PY^-"
Printer.Print "^PY^-"
Printer.Print "^F^-"
Printer.Print "^H44^-"
Printer.Print "^IPAGE,LAND^-"
Printer.Print "^M0201420^T0040"; Format(Date, "y") 'julian date
Printer.Print "^M0100010^T0393 QUANTITY (Q)"
Printer.Print "^I000^-"
Printer.Print "^O^-"
Printer.Print "^PN^-"
Printer.EndDoc

Thanks to all who contribute in Advance!

-Sillygirl
[ponytails2]
 
<<an excerpt of what was coded in VB>>

Was that VB for DOS?

regards Hugh,
 
Been there done that. I have coded in VGL/PGL before - have no problem - just what is the conversion - how to put ZPL which is the printer language for Zebras into Visual Basic 6.0.

Thanks.
 

I have done this in both vb6 and .NET
You cannot use printer.print, you must open the port the printer is connected to , I have provided sample code below.


Dim lYBarCode As Long
Dim lYText1 As Long
Dim lYText2 As Long
Dim lYLabelLen As Long

'Label Length=number of labels * 250
lYLabelLen = 1500
lYBarCode = 100 ' y pos for barcode
lYText1 = 110 ' y pos for tool code/loc code
lYText2 = 80 ' y pos for itemid

Open "LPT1:" For Output As #1

Print #1, "^XA^MMC^MNN^MTT^PON^PMN^JMA^PR4,4^JUS^CI0^XZ"
Print #1, "^XA"

Print #1, "^LH0,0^LL" & 150

Print #1, "^BY2,3,70^FT425," & lYBarCode & "^B3N,N,,N,N"
Print #1, "^FD12345^FS"
Print #1, "^FO400," & lYText1 & "^A0N25,25"
Print #1, "^FDCEMVAR1000X1000X20004FLHS^FS"
Print #1, "^FO665," & lYText2 & "^A0N25,25"
Print #1, "^FD12345^FS"
Print #1, "^XZ"
Close #1
 
Zarkon 4:

Thanks for your reply - do you mean you cannot use printer.print with VGL also - if so you are wrong with that however with ZPL - you are probably correct - however the printer is a networked printer not attached to the local port... and the IP address could change.
So what would I use on the open statement?
 
I believe you have to open it using it's ip address and port, I'm not sure of how to do this though, I did find it somewhere in the documentation.
 
I print zpl to netowrked printers using a Print Server provide by zebra that plugs into the LPT port. I actually write my ZPL to a text file and FTP the text file to the printer using the name of the print server as it is static. The IP is DHCP so it could change.

I tried to have patience but it took to long! :) -DW
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top