Dot Matrix printing in C#?

前端 未结 8 2094
南笙
南笙 2020-12-13 08:03

I\'m trying to print to Dot Matrix printers (various models) out of C#, currently I\'m using Win32 API (you can find alot of examples online) calls to send escape codes dire

8条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-13 08:34

    If your printer has driver to install, then you can use normal Windows print system. Most printers, including POS ones, have working Windows drivers available. (Most dot-matrix printers are Epson compatible anyway.) Some POS printer drivers allow send escape codes directly to printer too (using special fonts); probably you don't need such functionality.

    If this is not the case, then you can add Generic/Text Only printer (driver) with help of Add Printer Wizard. Once done, you can configure certain commands (escape sequences) for it - Font size 10/12/17, Bold on/off, Underline on/off, job start/stop, paper feed and size select.

    I'm using Generic printer associated with FILE port to test various reports for POS printers - it's easy to look at text file to validate numbers in printout. Of course for formatting specific printer driver is needed.

提交回复
热议问题