|
I have a print queue setup as network print queue. When i use it, it doesnt work.
the CreateFile api always returns -1 when i use print network queue name (eg \\server\testprintqueue1) and directly the printer name with ahnd with out "\\".
WHat is the thing i am missing in.
|
|
|
|
|
How to print Chinese character with this program?
I have test it many times but I can't sucess.
Anyony tell me?
|
|
|
|
|
i want to print 3 barcode values in a single label template.lbl file.
i have to pass values from text box to template.lbl and finally print in zebra printer..
in c# lang..
kindly help me...
|
|
|
|
|
Dear Sir/Mam,
I Wanted to developed web base application in which wanted t develop .lbl file through which wants to create prn file for TLP2844 Printer application.
The application will be online.....
Like as zebra designer on desktop.
Please help me out.
|
|
|
|
|
Hi,
I've been using this code as part of a program for years, and it's been working fine, until the program was installed on a computer running Win7
Now the program only works 'partly' . The thing is that the 'CreateFile' function returns '-1' from a shared printer, that connected to the same computer where the program is running (debugging in Visual Studio 2010), and so I can't get a handle to the printer.
A funny thing is that if I try to print from the Win7 computer, to a printer that is shared on another computer running Windows XP everything works fine
It doesn't work if I try to printer to another shared printes, on a computer running Win7
I've been wondering if Microsoft has changed how the 'CreateFile' function works in Win7 or if it's a UAC issue.
Please help - Thomas.
|
|
|
|
|
Thomas,
I am having the same problem. Using my Win 7 laptop with VS 2010 I create an executable and test on a XP desktop that has the zebra printer. It prints. I try in the debug mode on Win 7 and get an invalid handle error. So if you get an answer please let me know at edward.w.mee@boeing.com. I wish they would quit deprecating so much. I swear when I retire, I'm getting a Mac. Can't imagine what's waiting with Win 8.
Ed Mee
|
|
|
|
|
Hi Ed,
For get it all just try to create a text file contain your ZPL codes and copy it to shared Zebra Printer UNC path. It's worked for me in Windows 7 with IO.File.Copy(C:\MyCode.ZPL, \\mypc\zebra).
Nghia
|
|
|
|
|
As a download, it's good. As an article, you've got nothing that discusses the concepts behind this, nor how the code works, nor anything that makes want to download this and take a look around.
|
|
|
|
|
|
Hi,
I would like to know if it is possible to print Asian Characters using EPL2. I am doing a copy in Dos to LPT1 port, however the printer (LP 2844) is not printing the UTF-8 chinese characters but all the rest is printed.
Is it possible to use this framework to push the UTF-8 characters to the LPT1 port?
-ben
|
|
|
|
|
Can you tell me, if xebra printer could print a char "=" as separator in TRACK I, if it is possible, can you say me How I do it?.
Saludos desde la mitad del mundo
VICENTE ORTIZ
ENLACE INFORAMTICO
QUITO - ECUADOR
|
|
|
|
|
Hello everyone!
as you can see from subject, the antivirus installed on the company's pc is blocking the process that creates the file stream.
Can anyone tell me what process should be specified as an exception in the antivirus rules, so that it wouldn't be blocked.
To be more specific, i'm attaching the code from
_SafeFileHandle = CreateFile(printerPath, GENERIC_WRITE, 0, SA, OPEN_EXISTING, 0, 0)
'Create file stream
Try
_outFile = New FileStream(_SafeFileHandle, FileAccess.Write)
_fileWriter = New StreamWriter(_outFile)
Catch ex As Exception
The _safefilehandle=CreateFile returns "Nothing", and the try..catch block returns exception:
Invalid handle. Parameter name: handle
-------------------------
from antivirus event log:
Access 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.
-------------------------
Thanks,
Mihai.
|
|
|
|
|
Hi
Can anyone please help. When I have got the Printer attacted to the clients machine and I try to print I get the error invalid handle message. I am assuming its a permission issue can anyone help?
Thanks
Kind Regards,
Salma
|
|
|
|
|
Hi All,
I just wanted to post the solution to the problem in the web congig file I had to set the identity impersonate=True with a domain username and password. The syntax is as follows.
<identity impersonate="true" username="domain\username" password="password">
Hope this helps someone
Salma
|
|
|
|
|
I have configured my QL 420 Printer to print the EPL language.
When i tried ur test application to print some simple barcode, it is not printing. But it prints the Printer.pcx image very well.
The Label whatever i give is not being converted as barcode. What could be the problem.
Please help me to solve this issue.
Sriram
|
|
|
|
|
You have to make sure that you have the font for the BarCode text in your fonts folder in the windows folder.
|
|
|
|
|
Hi,
Hoping you help, when I run your code, thanks by the way, I am getting an unhandled handle, vs2005 says that the line = New FileStream(hPortP, FileAccess.Write) is deprecated and a safehandle should be used could you please explain?
Thanks
|
|
|
|
|
Reference:
Imports Microsoft.Win32.SafeHandles
Declare:
Dim handle As SafeFileHandle
In your sub:
'Get unsafe pointer
'hPortP = New IntPtr(_hPort) 'convert Integer to IntPtr
handle = New SafeFileHandle(New IntPtr(_hPort), True) 'Convert to safefilehandle
'Create file stream
_outFile = New FileStream(handle, access)
|
|
|
|
|
Hello and thank you for making it easy for others to use it.
Just one query,
Using vs 2008 for development, and is trying to use the code that you have mentioned.
Dim Texxxt As String
Dim SA As SECURITY_ATTRIBUTES
Dim handle As SafeFileHandle
Dim outFile As FileStream, hPortP As IntPtr
LPTPORT = "USB002"
Texxxt = Me.RichTextBox1.Text
hPort = CreateFile(LPTPORT, GENERIC_WRITE, FILE_SHARE_WRITE, SA, OPEN_EXISTING, 0, 0)
handle = New SafeFileHandle(New IntPtr(hPort), True)
' hPortP = New IntPtr(hPort) 'convert Integer to IntPtr
outFile = New FileStream(handle, FileAccess.Write) 'Create FileStream using Handle
Dim fileWriter As New StreamWriter(outFile)
fileWriter.WriteLine(" ")
fileWriter.WriteLine("N")
fileWriter.Write("A50,50,0,4,1,1,N,")
fileWriter.Write(Chr(34))
fileWriter.Write("Zebra")
fileWriter.Write(Chr(34))
fileWriter.Write(Chr(13))
fileWriter.Write(Chr(10))
fileWriter.Write("A50,100,0,4,1,1,N,")
fileWriter.Write(Chr(34))
fileWriter.Write("Tech Support")
fileWriter.Write(Chr(34))
fileWriter.Write(Chr(13))
fileWriter.Write(Chr(10))
fileWriter.WriteLine("P1")
fileWriter.Flush()
fileWriter.Close()
outFile.Close()
retval = CloseHandle(hPort)
End Sub
That is the code that i am trying to use, inorder to print my barcodes to a zebra TPL 2844 printer connected to my USB port.
The value of hport is coming -1 , that means nothing is being assigned to it, that's what i think.
Getting the same error, argumentexception, invalid handler.
Please reply to this as soon as possible for you..
Regards
|
|
|
|
|
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?
|
|
|
|
|