欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

c# .net 调用 TSC 打印机

最编程 2024-04-25 15:27:20
...
using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Runtime.CompilerServices; using System.Text; using System.Threading; using System.Threading.Tasks; using log4net; using TSCSDK; namespace CBSP { public class PrintHelpter { public static void PrintTest(dynamic bundle) { TSCSDK.driver usbprint = new driver(); if (usbprint.openport(PRINT_NAME)) { int w= bundle.w; int h=bundle.h; int g=bundle.g; float l = bundle.l; float t = bundle.t; usbprint.clearbuffer(); // 纸回拉指定长度 //TSC_DLL.sendcommand("BACKFEED 60"); //二维码 //需要清除上一次的打印记忆 usbprint.sendcommand("CLS"); usbprint.setup(w.ToString(), h.ToString(), "4", "15", "0", g.ToString(), "0"); string command = "QRCODE " + (int)(5) + "," + (int)(5) + ",H,8,A,0,M2,\"" + "p这是一段中文" + "\""; //System.Windows.Forms.MessageBox.Show(status); usbprint.sendcommand_utf8(command); usbprint.printlabel("1", "1"); usbprint.closeport(); } } } }

推荐阅读