windows一个特点就是设备无关性,这样就给程序控制打印机提供了很好的方法。
首先引用“泥人张”写的打印API类。

using System;

using System.Collections;

using System.Text;

using System.Runtime.InteropServices;

using System.Security;

using System.ComponentModel;

using System.Drawing.Printing;


namespace PrintAPI
![]()
}
然后在程序里调用写好的API即可。

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

using System.Runtime.InteropServices;

using System.IO;


namespace PrintAPI
![]()
...
使用到的Printer.ini配置文件

[Printer]

InvoicePrinter= pdfFactory Pro

ReceiptPrinter = pdfFactory Pro


[BillSize]

InvoiceWidth = 706

InvoiceHeight = 515


ReceiptWidth = 706

ReceiptHeight = 515
是不是很简单呢?
相关文章:
-
2022-12-23
-
2021-10-12
-
2022-01-07
-
2021-12-11
-
2022-12-23
-
2022-12-23
-
2022-12-23