Send ESC commands to a printer in C#

后端 未结 3 1539
长情又很酷
长情又很酷 2020-12-03 16:16

My application needs to print invoices, then a get the invoice from database, insert information on the invoice in a big string (telling the line, column, etc.) after this I

3条回答
  •  借酒劲吻你
    2020-12-03 16:32

    Bypassing the printer driver and controlling the printer directly, using its native command language, is a supported scenario. The P/Invoke is explained well in this KB article.

    Sure you want to do this? It is uncommon, to put it mildly, usually only attempted with low-cost Point-Of-Sale thermal or matrix printers. If you don't like the mechanics of PrintDocument.PrintPage, nobody does, you could consider my code in this thread. Note the FormFeed method.

提交回复
热议问题