1

有谁知道如何在以下 javascript 中使用 DirectIO 而不是 PrintNormal?

printer.Open("zebraprinter");
printer.ClaimDevice(1000);
printer.DeviceEnabled = true;
printer.PrintNormal(2, "^XA");
printer.PrintNormal(2, "^LH0,0");
printer.PrintNormal(2, "^FO100,100^ASI^FDTest^FS");
printer.PrintNormal(2, "^XZ");
printer.MarkFeed(3);
printer.DeviceEnabled = false;
printer.ReleaseDevice();
printer.Close();
4

1 回答 1

0

这是 C#(Microsoft POS for .Net)代码:

PosExplorer ex = new PosExplorer();
DeviceInfo d = ex.GetDevice(DeviceType.PosPrinter, "zebraprinter");
PosPrinter printer = (PosPrinter)ex.CreateInstance(d);

printer.Open();
printer.Claim(1000);
printer.DeviceEnabled = true;

printer.DirectIO(0, 0, "^XA");
printer.DirectIO(0, 0, "^LH0,0");
printer.DirectIO(0, 0, "^FO100,100^ASI^FDTest^FS");
printer.DirectIO(0, 0, "^XZ");

printer.DirectIO(0, 0, "^MFN,F");

printer.DeviceEnabled = false;
printer.Release();
printer.Close();

请注意,我没有测试上面的代码,但代码应该接近你想要的。

于 2012-06-22T12:33:19.210 回答