i have created an application which uses a Zebra printer to print a GS1 barcode. Actually it has an Oracle backend which generates a string and c# just passes the data to the printer.
System.Net.Sockets.TcpClient zClient = new System.Net.Sockets.TcpClient();
zClient.Connect(zIP, zPort);
System.IO.StreamWriter zWriter = new System.IO.StreamWriter(zClient.GetStream());
zWriter.Write(zgs1);
zWriter.Flush();
zWriter.Close();
zClient.Close();
Now i need to test the GS1 barcode printing on a "normal" network printer with A4 paper.
Can somebody tell me how i can achieve that? In principle i would prefer to generate a string from Oracle and pass it on somehow to the printer through the c# application.
Thank you
EDIT: Thanks for the comments. I do not know how to print/transfer as GS1 code a string received from Oracle, for instance (without quotation marks) "(00)360222014120423545(15)141204(10)4805-397-TR". Form the comments i understand the only way is to render it first as PDF or image and then send it to the printer?If yes, how can i do that? I searched around but didn't really find free solutions. The printer (IP) is fixed.
I have managed to solve the problem by using PrintDocument and the Spire.BarCode for .NET dll.
Related
I have a requirement whereby I need to be able to send an image to a printer.
The problem I have is that the target printer (and type) is not necessarily know at the time of printing and we could be sending to a zebra/intermec label printer or a standard HP office jet.
One further complication is that we have hundreds of printers to manage.
I do not want to have to install hundreds or printers and have to manually install a new printer every time we add one to the network. We maintain a list of IP Addresses and ports.
I have been considering installing a default printer (zebra, intermec, officejet) for each of the printer types.
When printing (using PrintDocument) I can send a print to the default printer of that type but mark the output as "PrintToFile". I believe this would then give me the raw print data (PCL?).
My thought process is that I should then be able to simply send the raw data to the printer? Unfortunately this does not seem to work and the raw text is simply printed.
Can anybody offer some advice/help?
Thanks in advance.
Raw files will not be sharper than the JPG files on printing, for me the best solution is to convert the RAW file in JPG
I've been programming an application that deals with a POS printer. The printer is BIXOLON branded, and I haven't found any SDKs for using this type of printers as well as no example on how to deal with it.
Since I'm new to this type of printer, I don't know how should I design my report as well as which report engine should I use.
Any advice will be helpful.
I have worked on POS printers before to issue receipts etc.
What I did is to read in a template from a rtf file, set some variables that is to be replaced.
For example for the receipt I want to have the name of the person, so in the rtf file template, I would put something like <NAME>. When I read in the content of the rtf file, i just do a string.replace to replace <NAME> with the actual text in my program. Once I have replaced all the variables, using the class found in this link.
http://msdn.microsoft.com/en-us/library/ms996492.aspx#wnf_richtextbox_topic06 , I have a well formatted rtf and ready to be printed.
Printing wise works just like other printer. This means that as long as your coding targeted the correct printer and using the correct setup, it should be printed correctly. The only difference is that printing on a office printer would give u a A4 size, whereas printing on a POS printer will give you the size allowed by the POS printer. Just remember to format your rtf well.
Most report engines (I'm thinking of Reporting Services in particular) won't need this level of programming to print reports. You will get that functionality out of the box as long as the printer drivers are installed on the machine you wish to print reports from.
It was so simple, I used crystal report to design my report and then easily show.
I've been trying in TM88III to print barcode using ESC POS command.
But it only returns a HRI character.
Assuming i am tottaly wrong and I am a worthless coder. Can you guide me to print exact barcodes using EPSON TM88III Thermal Printer?
Other commands works well except barcode...
I am using MSDN's method to send raw data to the printer.
You might try posting a simplified example of the code you're using. There are lots of things you might be doing wrong, for example using the wrong Encoding when outputting a string to the serial port.
I need to print to barcode printer (zebra) from windows-mobile 2005 (motorola hc700)
I search any sdk...not fount how to print.
thank's for any help
Check out the new mobile SDK from Zebra. It works with BlackBerry and Windows Mobile
ZebraLink Multiplatform SDK
This is based on my experience from 2006.
I had to use sockets in C# to send ZPL code to the printer. The "ZPL Code Generator" was hard-coded specifically to the one label format we needed; however, a template file with strategically placed search-and-replace strings would have been a better solution. There was a ZPL guide included with the printer and I'm sure you can get one from their website.
The Windows drivers were awful at the time and only produced garbage output. A couple developers before me had other approaches and both failed after a few weeks.
Edit:
Link to MSDN .Net Sockets. When
From my project, the port you should use is 6101. But that may be specific to the QL320.
The ZPL guides from Zebra are pretty good and I had little reason to devote the language to memory because it was just one small project.
Also, your printer may use EPL instead of ZPL but Zebra's guide for that is equally good. Either way, if the text you are sending to the printer is relatively constant, just create a file that correctly prints when streamed to the printer and then put in "replace me" blocks for your app to put in the dynamic values.
I'm also assuming that you are accessing this via a network. If your connecting it directly to the device, this changes slightly (I believe it gets mapped to COM port for most devices).
All that, and no mention of
http://www.zebra.com/id/zebra/na/en/index/products/software/label_design_software/label_vista.html
We developed our label code by creating the labels in label vista and using telnet to send them to the printer for printing. Repeat until you have it like you want, then code it.
i m using Dotmatrix printer EPSON for printing the reports, and i need the of how to print the reports without using crystalReport and print dialog, i.e. i want the code for DOS based printing in C#.net.........
I know a very old and dirty way. Just open LPT1 (or the printer port you are using) as a stream and output the characters.
Maybe this will help? http://support.microsoft.com/kb/322091/EN-US
Does your printer appear in windows? In other words, can your print to it from notepad? Then you can still use the System.Drawing.Printing namespace and send data to your printer that way.
This is if you need to print anything other than character data - otherwise, do like tekBlues said.