开发者

pass the data to printer as a raw data

I am working with a zebra printer that is defined as default printer on my machine.

I want to pass to the zebra driver all the information as a raw information, tell the printer driver not to encode anything going to the printer, but to pass it along unchanged.

I开发者_开发技巧 want to use PrintDocument, is this possible?

Or would you suggest something else?


If you go to the "Advanced Setup" tab of the Zebra printer driver, you can "Enable Passthrough Mode". Then, just ensure that your stream starts with ${ and ends with }$ Then the driver will not do anything to the stuff inbetween the ${ }$


In my experience, going through the Windows print drivers was overly complicated for Zebra printers. If you can build up the ZPL, there are two options (one real easy and the other slightly complicated):

  1. Save the ZPL to a file and FTP it to the printer.
  2. Stream the ZPL to the printer via sockets.

I've done both in the past and, as far as I know, both systems are still running without issue.


You can't just print any raw data to zebra printer. The printer will only recognize commands that are supported by the printer languages ie: ZPL, EPL or both in some models.

Printdocument is possible provided one of the above mentioned codes are written in the text file that you are sending to the printer. Eg.:

^XA
^FO50,50
^A0N,30,30^FDTEST PRINT^FS
^XZ

Save these commands in notepad and save it as, lets say, "test.txt". Now you can print this document directly to the printer by executing following DOS command (assuming the printer is connected via LPT2 port)

Open a DOS prompt and type:

copy test.txt lpt2

If the printer is connected via a USB port, install "Generic / Text Only" printer (available in Windows by default) and then open the notepad and print to Generic / Text Only printer.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜