打印在.NET针式打印机针式打印机、NET

2023-09-03 01:18:22 作者:Follow Me

任何人都可以请告诉我code如何打印的针式打印机的文件在C#中的Windows应用程序。

anyone can please tell me the code how to print documents on dot matrix printer in C# windows application.

推荐答案

您可以打印到点阵图形,它是内置在Windows,尽管速度较慢。

You can print to dot matrix "graphically", which is built-in in Windows, albeit slower.

不过,如果你只想打印纯文本简单的打印格式,你需要发送逃生命令,你的针式打印机,它比图形的打印速度更快。不同的打印机有不同的逃生命令。

But if you only want to print pure text with simple formattings, you need to send escape commands to your dot matrix printer, which is faster than graphical printing. Different printers has different escape commands.

下面是典型的逃生命令(EPSON): http://www.printfil.com/manualen/c5.htm

Here are typical escape commands(for epson): http://www.printfil.com/manualen/c5.htm

这可能会帮助:http://www.sacpcug.org/archives/0306/prc0603.html

我做的VB6,然后是打印为仅通用/文本打印机,你打开PRN或LPT1作为一个文件句柄,然后打印的文件句柄逃生的命令,所有逃生的命令将被重定向到任何打印机连接到LPT1或PRN。你可以做同样的事情用C#,刚打开PRN或LPT1作为一个文件,然后打印到它。

What I do in VB6 then was to print to Generic / Text Only printer, you open the PRN or LPT1 as a file handle, then print escape commands on the file handle, all escape commands will be redirected to whatever printer is attached to LPT1 or PRN. You can do the same thing with C#, just open the PRN or LPT1 as a file, then print to it.

要添加的仅通用/文本打印机,控制面板>打印机>添加打印机。在制造商,选择通用,然后在打印机,只选择通用/文本。

To add Generic / Text Only printer, Control Panel > Printers > Add Printer. On manufacturer, select Generic, then on printers, select Generic / Text only.

您可以这样做(打印在仅通用/文本)为Zebra打印机有自己逃生的打印条码codeS,这是不是让Windows打印将其图形更快命令

You can do the same (printing on Generic / Text Only) for Zebra printers which have their own escape commands for printing bar codes, which is faster than letting Windows print to it graphically.

 
精彩推荐
图片推荐