Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/337.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
斑马卡打印机通过C#.NET代码_C#_Printing_System.drawing_Zebra Printers - Fatal编程技术网

斑马卡打印机通过C#.NET代码

斑马卡打印机通过C#.NET代码,c#,printing,system.drawing,zebra-printers,C#,Printing,System.drawing,Zebra Printers,我开发了一个C#.NET应用程序来打印卡片,它可以在Fargo DTC 1000打印机中工作。 现在我已经改变了我的打印机(Zebra ZXP系列3),用于同样的目的,打印卡片(仅文本),但它不工作。 我总是收到错误“吱吱作响的丝带”,但我已经改变了它。 如果我从记事本发送打印,打印机工作正常 应用程序通过局域网与服务器中共享的打印机通信。 应用程序-->服务器-->计算机-->打印机 总之,代码工作,打印机工作,我也通过代码到达打印机。问题是我无法通过代码让它工作 我正在使用System.Dr

我开发了一个C#.NET应用程序来打印卡片,它可以在Fargo DTC 1000打印机中工作。 现在我已经改变了我的打印机(Zebra ZXP系列3),用于同样的目的,打印卡片(仅文本),但它不工作。 我总是收到错误“吱吱作响的丝带”,但我已经改变了它。 如果我从记事本发送打印,打印机工作正常

应用程序通过局域网与服务器中共享的打印机通信。 应用程序-->服务器-->计算机-->打印机

总之,代码工作,打印机工作,我也通过代码到达打印机。问题是我无法通过代码让它工作

我正在使用System.Drawing API

求你了,我终于有了我所有的想法。 提前谢谢你

这是主要的方法

public void Print()
    {
        if (Parameter == null)
            throw new Exception("No existen parametros para la impresión");

        PrintDocument pd = new PrintDocument
                               {
                                   DefaultPageSettings =
                                       {
                                           Landscape = true,
                                           Margins = new Margins(0, 0, 0, 0)
                                       },
                                   PrinterSettings = {PrinterName = Parameter.PrinterName}
                               };
        pd.PrintPage += pd_PrintPage;

        pd.Print();
    }

    private void pd_PrintPage(Object sender, PrintPageEventArgs ev)
    {
        Font printFont = new Font("Arial", FontSize, FontStyle.Bold);
        SetDataToPrint(Parameter.IdMovItem);

        ev.Graphics.PageUnit = GraphicsUnit.Inch;

        ev.Graphics.DrawString(Data.Asegurado, printFont, Brushes.Black, Parameter.AseguradoX, Parameter.AseguradoY,
                               new StringFormat());

        ev.HasMorePages = false;
    }

必须使用Zebra Technologies提供的。斑马打印机不像普通打印机那样工作。我必须实际使用他们的SDK,并通过USB连接使用驱动程序进行打印。当涉及到ZXP3时,信息是非常模糊的,一切都是原样。祝您好运。

您的Zebra打印机是否需要使用ZPL语言进行打印?我怀疑此线程可能有帮助@Alex我如何知道我的打印机是否需要ZPL语言?非常感谢你