在线等,关于Zebra通过USB接口打印的问题
请教下各位大虾,
我在做一个简单的程序,以前在使用LPT口的时候,没问题,最近电脑换了,新的电脑没有LPT接口,只有USB
那么以前很简单的,DOS下“copy code.txt LPT1"就可以让Zebra打印了,这里code.txt里面放的是Zebra ZPLII语言写的代码
在USB接口下,参考过别人写的
PrintDocument printDocument = new PrintDocument();
printDocument.PrintPage += new PrintPageEventHandler(this.pd_PrintPage);
printDocument.Print();
private void pd_PrintPage(object sender, PrintPageEventArgs e)
{
Font mainFont = new Font("Courier New", 8);
string strLine = this.scriptStr;
e.Graphics.DrawString(strLine, mainFont, Brushes.Black, PointF.Empty);
}
this.scriptStr是ZPLII语言代码的字符串
可以和Zebra打印机连接,但是打印出来的是代码,也就是直接拔scriptStr这个字符串的内容给打印出来了,并没有将字符串中的ZPLII转成条码打印出来。
各位大虾给点指导,拜谢~~