|
i have the same problem any solution?
|
|
|
|
|
Hi, i this code is awesom it helped me a lot. Thx for publixhing it
But, i still can't get round an issue here, u see, i need to write multiple lines (up to 4) on the label and then a barcode with human readeable data.
What happens is that if i send a string like "hello\r\nJuanhello\r\nJuanhello\r\nJuan" to 1 command it writes it all in the same line and the letters overlap.
So i send 1 command per word, that helped, but what actually happens it that it now writes the last word only (Juan)
I'm thinking there might be a problem with the dimensions the printer gets to write the lines, like, is printing it all but not on the label...
i really ran outta ideas of how to fix this, and i cannot se nowhere in the code where the label's dimensions concerning the text only are, since the bar code prints perfectly
I'll be waiting for anything u can throw at me. thx
btw: i'm writing this in c# .net!
Thx!!
|
|
|
|
|
This would be a reply to myself...
Accostumed to work with wordprocessors and all, the thing is that i forgot
that i was passing the same coordinates to every single line i wrote, therefore
all lines were going to overlap!
my bad!
|
|
|
|
|
Great example and greatly appreciate the work. Can someone help with adding in variable and how to use what template? Basically I am working in VB.NET 2005 in creating a small application that pulls data from a SQL database and than print it to the label.
I was able to take the Zebra design label software to create a template call templabel.lbl with some variable. How would I specify so that ID textfield is tied to variable ID and so on?
|
|
|
|
|
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
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
|
|
|
|
|
Are you using the free version?
|
|
|
|
|
i was getting the same exception error, which was due to the CreateFile function returning a -1. This seemed to be caused by a bad lpFileName parameter (the first argument for the CreateFile function) So here are some measures to ensure the lpFileName is valid.
First, make sure that your printer is SHARED, even if it's on the local machine!!! This alone may be enough to solve the issue.
The following link http://www.answers.com/topic/createfile demonstrates how to prepend the \\?\UNC\ to the first parameter of the CreateFile function, which may resolve the issue for some of you as well. Ideally you want to end up with something like \\?\UNC\computer\printer
joshb
joshb@sane.ca
-- syntactic is our elegance, incisive our disease --
|
|
|
|
|
Hi,
This code looks great, I am looking for something similar but for a Zebra P120i ID Card printer.. I've tried this code, but it sends a job to the queue, processes it, but does nothing...
Cheers
Nick
|
|
|
|
|
Did you find any solution for that ? I have 430i card printer and same thing happens.
|
|
|
|
|
Hi! is there a way to retrieve values return from calling ~HS and ~HI. I don't know if i'm asking the correct question here.
(",)
|
|
|
|
|
Thanks for the code, seems like it works great (mostly). I have tried this on two pc's and it worked flawlessly. I just tried it on another one, and I am getting the "Invalid handle" error.
I am using your dll files, and have tried a variety of handles from LPT1, "ipaddress/sharename", all which worked on the other computers but not this one. Any idea what might cause this?
|
|
|
|
|
Is it possible to use either the DLL or class as part of a web application to print labels on the server side? I have included it in a windows form without problems. In a web form, I get the following error messages:
with DLL:
"Invalid handle. Parameter name: handle"
at line: "print.StartWrite("\\M-shippingxp\\putaway")"
with VB class:
"Invalid handle. Parameter name: handle "
at line: "_outFile = New FileStream(hPortP, FileAccess.Write)"
Any help would be appreciated!
|
|
|
|
|
you should put ("\\\\M-shippingxp\\putaway")
|
|
|
|
|
Hey! i have a similar problem.
If i'm printing from a local application in works fine, even when printing to a shared printer on a different PC.
When i try to print from my asp web site, it throws the "invalid parameter: handle" error.
How do i resolve this issue?
Mihai
|
|
|
|
|
If your web site runs on Windows Server 2008 most likely the error comes from insufficient rights NETWORK SERVICE has on accessing external resources. In this case the only solution I found was to create a normal user, and set pe application pool run on it.
If this is not the case try to get the last IO error using:
System.ComponentModel.Win32Exception ex = new System.ComponentModel.Win32Exception();
errMsg = ex.Message;
and investigate from there...
Mircea
|
|
|
|
|
10x Mircea.
Changing the user solved my problem
Mihai
|
|
|
|
|
Please can you explain where you changed the user in the web config file??
Thank you.
|
|
|
|
|
Has anybody been able to print images (PCX format) to a zebra printer? could you post an example code?. thanks
|
|
|
|
|
Hello.
i've just finished doing this. it's not complicated: you just need to share this code so that the filestream you're using uses the correct encoding (i've used the 1252 encoding).
After changing this, you just need to use the bitmap class and its lockbits method in order to get the stride in order to copy the bits to the stream that is sent to the printer.
i'll be publishing an article about this in my blog in the next days:
http://msmvps.com/blogs/luisabreu
--
Regards,
Luis Abreu
|
|
|
|
|
Hi Luis, thank you for your reply, I've been able to print images to my zebra printers (QL320, QL420+) using an excellent project developed by Vino Rodrigues. His project is "Z-Bar: .NET for Zebra Printer" hosted on http://sourceforge.net/projects/z-bar/[^], wich works with CF2. I didn't specify that I was working with CF1 and it's bitmap class doesn't have a lockbits method. Anyway, I'll read your post as soon as possible.
|
|
|
|
|
The code has been create to use with the LTP port, it works perfect, but if I want to print using the USB port, how can i do it?
Thank you
|
|
|
|
|
Ha sido un error mío. He confundido la solución con el enlace de partida, que solo estaba pensado para LPT. Cambiando el nombre de la impresora funciona perfectamente.
Siento la confusión.
|
|
|
|
|
what?! this website is english.
|
|
|
|
|
Within your Printer Properties, you can enable printer spooling and map it to both the USB00x AND LPT1 ports. Then even a USB connected printer will work when printing to LPT1
-----------------------------
Clint MacDonald, BASc, Civ. Eng
InterGlobal Solutions
Waterloo, Ontario Canada
519-576-1644
http://www.interglobal.ca
|
|
|
|
|
I've included USB support in Z-Bar project (http://z-bar.sf.net) - may not be an "out of box" solution for you - but you can leverage the source base to expand to your needs.
Vino Rodrigues
|
|
|
|
|