Label printing with c#
-
Hello, I want to write a C# label print application. My printer is Zebra P4T. My label size is 3x3 cm one column one row. I tried some libraries, RawPrinterHelper class etc. but they didn't fit. What is your advice to start with? Thanks.
Try the PrintDocument class: it lets you position and size things exactly as you wish. PrintDocument Class (System.Drawing.Printing)[^]
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
-
Hello, I want to write a C# label print application. My printer is Zebra P4T. My label size is 3x3 cm one column one row. I tried some libraries, RawPrinterHelper class etc. but they didn't fit. What is your advice to start with? Thanks.
To print to a Zebra printer, you'll need to combine the
RawPrinterHelper
class with ZPL commands: ZPL2 Programmers Manual[^] Here's the class I use[^] - just callRawPrinterHelper.SendStringToPrinter(zplPrinterName, zplDocument, null)
to send the specified ZPL commands to the printer. This tool[^] lets you preview your ZPL document online, although you might find some subtle differences between the tool and your printer.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
Hello, I want to write a C# label print application. My printer is Zebra P4T. My label size is 3x3 cm one column one row. I tried some libraries, RawPrinterHelper class etc. but they didn't fit. What is your advice to start with? Thanks.
There are some options to do it. One is that with Zebra printers you are receiving also software to create labels fe. Zebra Designer. You can create tamplate in this software, save it as text file (it will be ZPL language) and in your application you will read this template then you will do string replace with your data and send it all as text to the printer. Other option is to generate pdf file in your app and send pdf file with your label to printer. But printer will need to support it.