如何用C#打印标签(不是条形码)? [英] How print label (not barcode) with C# ?

查看:142
本文介绍了如何用C#打印标签(不是条形码)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace TSCLIB_DLL_IN_C_Sharp
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {      

            //TSCLIB_DLL.about();                                                                  // show the dll version            
            //TSCLIB_DLL.openport("\\10.10.30.102\tscta210");
            //TSCLIB_DLL.openport("USB");
            TSCLIB_DLL.openport("\\10.10.30.102\tscta210");                                                       //Open specified printer driver
            TSCLIB_DLL.setup("149 mm", "38 mm", "3", "8", "0", "0", "0");                            //Setup the media size and sensor type info
            TSCLIB_DLL.clearbuffer();                                                              //Clear image buffer
            //TSCLIB_DLL.barcode("100", "100", "128", "100", "1", "0", "2", "2", "Barcode Test");  //Drawing barcode
            TSCLIB_DLL.printerfont("100", "250", "3", "0", "1", "1", "Print Font Test");           //Drawing printer font
            TSCLIB_DLL.windowsfont(100, 300, 24, 0, 0, 0, "ARIAL", "Windows Arial Font Test");     //Draw windows font
            //TSCLIB_DLL.downloadpcx("UL.PCX", "UL.PCX");                                          //Download PCX file into printer
            //TSCLIB_DLL.sendcommand("PUTPCX 100,400,\"UL.PCX\"");                                 //Drawing PCX graphic
            //TSCLIB_DLL.sendcommand("SIZE 4mm , 2.5mm");
            //TSCLIB_DLL.sendcommand("BOX 10,300,300,300,5");

            //TSCLIB_DLL.sendcommand("DIRECTION 1");
            //TSCLIB_DLL.sendcommand();
            //TSCLIB_DLL.sendcommand();
            //TSCLIB_DLL.sendcommand();

            TSCLIB_DLL.printlabel("1", "1");                                                       //Print labels
            TSCLIB_DLL.closeport();                                                                //Close specified printer driver 
            
        }
        
    }
}





我的项目是TSC(TSC TA210)打印机的标签打印(非条形码)。这段代码片段就在那里。并且我收到错误消息未指定打印机。但我正确描述了打印机名称。我不明白缺少代码或描述,定义,语法和另一种方法



我有什么试过:



用c#编译程序。然后我收到一条错误消息未指定打印机驱动程序。 (Visual Studio 2012)Windows窗体应用程序



My project is label printing (not barcode) with TSC(TSC TA210) Printer. This code snippets is there. And I get a error message "Printer is not been specified." But I describe correctly printer name.I don't understand lack of code or describe, define, syntax and ANOTHER METHOD

What I have tried:

With c# I compile program. And then I get a error message "Printer driver is not been specified." (Visual Studio 2012) Windows Form application

推荐答案

这是与特定DLL文件交互的代码 - 可能是由实际打印机的制造商提供的。因此,您需要问的人不是我们:编写DLL的人就是这样。即打印机的制造商!

他们应该通过论坛,电子邮件或电话获得技术支持 - 他们最适合帮助您,因为您需要知识很少的DLL(如果有的话) )这里的人们将要使用。



从他们的网站开始,看看你能找到什么。
This is code which interacts with a specific DLL file - which presumably is supplied by the manufacturer of the actual printer. As such, the people you need to ask is not us: it's the people who wrote the DLL. I.e. the manufacturers of the printer!
They should have technical support - via a forum, email, or phone - and they are best placed to help you as you require knowledge of a DLL that very few (if any) people here are going to be using.

Start with their website, and see what you can find.


这篇关于如何用C#打印标签(不是条形码)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆