Click here to Skip to main content
15,923,789 members
Articles / Programming Languages / Visual Basic
Article

Zebra EPL2 Printing in .Net

Rate me:
Please Sign up or sign in to vote.
2.57/5 (9 votes)
7 Jul 2006CPOL 317.2K   12.2K   39   53
Print to zebra printers using EPL2 commands

Introduction

Attached is a good example on how to print to Zebra printers using the EPL2 commands in .Net.  In the attached file you will find 2 VB.Net 2003 Projects.  The project ZebraPrint is a good reuseable dll file (or you could just use the class) that you can use in VB.Net 2003 or 2005.  The project ZebraTest demonstrates how to print using ZebraPrint.  I have tested it using a Zebra TLP 2844 over a TCP/IP network.  I have not tested it over a COM or Parallel port yet, but in theory it should work.

 

Referances:

https://support.zebra.com/cpws/docs/zpl/zpl_elp_vbnet.htm

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionprinterPath is exactly what Pin
Rahul A18-May-17 7:29
Rahul A18-May-17 7:29 
SuggestionHow to print Chinese character?? Pin
hysen_hu21-Feb-12 1:02
hysen_hu21-Feb-12 1:02 
QuestionHelp me todo same in c# . i dont know vb.net Pin
suhaskumar86.sg10-Feb-12 3:30
suhaskumar86.sg10-Feb-12 3:30 
QuestionHow to generate .lbl file in asp.net using c# Pin
Harishkavita3-Aug-11 23:54
Harishkavita3-Aug-11 23:54 
QuestionWin7 problem Pin
TN_DK22-Feb-11 0:32
TN_DK22-Feb-11 0:32 
AnswerRe: Win7 problem Pin
EdMee7-Apr-11 13:05
EdMee7-Apr-11 13:05 
GeneralRe: Win7 problem Pin
Chi Nghia7-Dec-11 4:55
Chi Nghia7-Dec-11 4:55 
GeneralMy vote of 1 Pin
Dave Kreskowiak28-Feb-10 17:01
mveDave Kreskowiak28-Feb-10 17:01 
GeneralTHANKS VERY MUCH!!!!!!! [modified] Pin
w3rm18-May-09 9:24
w3rm18-May-09 9:24 
GeneralPrinting Asian Characters Pin
b_basa19-Mar-09 4:29
b_basa19-Mar-09 4:29 
GeneralZebra Track I Pin
VHOGUE28-Jan-09 16:42
VHOGUE28-Jan-09 16:42 
QuestionAccess to object C:\WINNT\System32\spool\PRINTERS\00004.SPL was blocked by rule Anti-virus Standard Protection:Prevent remote creation/modification of executable and configuration files. Pin
Mihai Antofi23-Jan-09 5:05
Mihai Antofi23-Jan-09 5:05 
Generalprinting from web app- Invalid handle. Parameter name: handle Pin
GeniousSal15-Jan-09 2:44
GeniousSal15-Jan-09 2:44 
GeneralRe: printing from web app- Invalid handle. Parameter name: handle Pin
GeniousSal15-Jan-09 23:38
GeniousSal15-Jan-09 23:38 
GeneralProblem Printing in QL420 Printer Pin
ajsri778-Oct-07 22:25
ajsri778-Oct-07 22:25 
GeneralRe: Problem Printing in QL420 Printer Pin
sarria88@gmail.com25-Feb-09 7:03
sarria88@gmail.com25-Feb-09 7:03 
QuestionNew FileStream(hPortP, FileAccess.Write) Pin
TheRealRhodieboy25-Sep-07 8:27
TheRealRhodieboy25-Sep-07 8:27 
AnswerRe: New FileStream(hPortP, FileAccess.Write) Pin
Member 46736974-Jun-09 11:23
Member 46736974-Jun-09 11:23 
GeneralRe: New FileStream(hPortP, FileAccess.Write) Pin
Shoaib Mateen11-May-10 18:34
Shoaib Mateen11-May-10 18:34 
GeneralRe: New FileStream(hPortP, FileAccess.Write) Pin
Guido Nicolas Quadrini9-Apr-17 11:58
Guido Nicolas Quadrini9-Apr-17 11:58 
QuestionCAn anyone lend me ahand ? Pin
DevForRent6-Sep-07 5:28
DevForRent6-Sep-07 5:28 
AnswerRe: CAn anyone lend me ahand ? Pin
DevForRent6-Sep-07 5:42
DevForRent6-Sep-07 5:42 
QuestionVariable and Template? Pin
NewZebraUser17-Jul-07 8:47
NewZebraUser17-Jul-07 8:47 
AnswerRe: Variable and Template? Pin
Sing Abend23-Aug-07 10:49
professionalSing Abend23-Aug-07 10:49 
Did you get an answer? If not, let me know I'll send you some code.
YOU MUST read the EPL2 manual to lookup the rules:
There is a section in there with an example.

Here is a sample EPL2 template:

There are bascally 4 sections.
1)initialization commands
2)Variables section
3)Others(anything else, captions , line etc...)
4) the variables data values section(this is the one that will get you!)
The number of variables must be equal to the number of of values lines or else...
You can use the same

REMOVE THIS LINE[ SECTION 1]:
O
D8
S2
ZT
JF
I8,0
OD
REMOVE THIS LINE[ SECTION 2]:
FK"FORMNAME"
FS"FORMNAME"
V00,40,N,""
V01,40,N,""
V02,25,N,""
Q812,24
q812
REMOVE THIS LINE[ SECTION 3]:
A37,12,0,2,2,2,N,"CAT's NAME:"
A405,43,0,3,1,1,N,"CAT'S WEIGHT:"
A75,139,0,3,1,1,N,V00
A227,938,0,3,1,1,N,V01
A392,558,0,4,1,1,N,V02
FE
FR"GEReturn"
REMOVE THIS LINE[ SECTION 4]:
?
V000DATAVALUE
V001DATAVALUE
V002DATAVALUE
Wink | ;) REMOVE THIS LINE[ P1 = print 1 page P2 means print pages and so on.]:
P1
FK"FORMNAME"
REMOVE THIS LINE[ in FK"FORMNAME" the name quotes MUST be 8 chars or less]


I hope this helps

AnswerRe: Variable and Template? Pin
Sing Abend24-Aug-07 10:39
professionalSing Abend24-Aug-07 10:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.