如何再c#中跟条码打印机交互?
Nlf 2006-07-15 09:13:52 这个是技术服务提供的代码,但是我们需要c#的,之前也没有做跟硬件接口类的所以不太熟悉,请教大家应该怎么写?根据我的理解,可能需要传一个string入打印机,应该怎么作?
Hi all,
When printing the label by your applications, please replace those red colour data by your parameters. The size and the location of the TEXTs may need to modify to create a better view.
ofstream fout; //declare file-stream handle
fout.open("lpt1:", ios::out); //open out to lpt1:
fout<<"^XA"; // start ZPL command
fout<<"^FO11,19^A0N,17,16^FDYXX^FS"; // define the locate of the printout and the size of the font is 17 x 16
fout<<"^FO45,19^A0N,17,16^FDXXXXX^FS";
fout<<"^FO95,19^A0N,17,16^FDAA^FS";
fout<<"^FO121,19^A0N,17,16^FDB^FS";
fout<<"^FO11,40^A0N,13,12^FDMM/DD/YY^FS"; // define the locate of the printout and the size of the font is 13 x 12
fout<<"^FO81,40^A0N,13,12^FDC^FS";
fout<<"^FO103,40^A0N,13,12^FDD^FS";
fout<<"^FO11,59^A0N,13,12^FDPF^FS";
fout<<"^FO45,60^A0N,13,12^FDKF^FS";
fout<<"^FO73,60^A0N,13,12^FDDD^FS";
fout<<"^FO95,61^A0N,13,12^FDI^FS";
fout<<"^BY1,3,15^FO11,80^BCN,,Y,N^FD0705610065^FS"; // print barcode 128 with human readable
fout<<"^PQ1"; //print one label
fout<<"^XZ"; //sending end of zpl Print one
fout.close(); //close file
Please contact me if any unclear.