private void PrintTask()
        {
            while (this.counter < this.stopCounter)
            {
                // StringBuilder msg = new StringBuilder();
                //int i = HotPrinterImporter.PrintLine(this.txtPrintContent.Text.Trim(), msg);
                //if (i == 0)
                //{
                TemplatePrintObject printer = new TemplatePrintObject(config);
                CommonPrinter commonPrinter = new CommonPrinter(printer);
                commonPrinter.SetPaperSize(config.PageWidth, config.PageHeight);
                commonPrinter.Print();
                counter++;
                //}
                this.setHint("正在打印:" + counter.ToString() + "页!");
                System.Threading.Thread.Sleep(this.threadSleepTime * 1000);
                if (this.counter == this.stopCounter)
                {

                    this.setHint("打印完成:" + counter.ToString() + "页!");
                    this.btnBeginPrint.Enabled = true;
                    this.btnEndPrint.Enabled = false;
                    break;
                }

            }
        }
 private void btnPrint_Click(object sender, EventArgs e)
 {
     TemplatePrintObject printer = new TemplatePrintObject(config);
     CommonPrinter commonPrinter = new CommonPrinter(printer);
     commonPrinter.SetPaperSize(config.PageWidth, config.PageHeight);
     commonPrinter.Print();
 }