Search code examples
c#printingplaintextzebra-printerszpl

c# send plain text to default printer (Zebra printer)


What is the best option to send text to the default printer?

The printer is a Zebra, and the text is a string of ZPL.

Many examples out there are with font size, graphics, points (x,y). Very confusing.

But I need to send the string and the printer does its work.


Solution

  • You can open the port directly using a p/invoke to OpenFile if you are connected using LPT or COM ports, but otherwise you will need to use the print ticket APIs to create a RAW formatted job. See http://support.microsoft.com/?kbid=322091 for a helper class which calls the appropriate platform functions to allows RAW print jobs from C#.