日期:2014-05-17  浏览次数:21357 次

C# PrintDocument调用针式打印机没有反应,调用普通打印机可以打出来, 求高手指点!!!
十万火急, 客户催得我想跳楼

这是我的打印代码

 public PrintDocument pdDocument;
        public PageSetupDialog dlgPageSetup;
        public PrintPreviewDialog ppd;
        public PrintDialog pd;
        private string[] lines;

        public string[] Lines
        {
            get
            {
                if (ViewState["Lines"] != null)
                    return ViewState["Lines"] as string[];
                return null;
            }
            set
            {
                lines = value;
                ViewState["Lines"] = lines;
            }
        }

        public PrintHelper()
        {
            pdDocument = new PrintDocument();
            dlgPageSetup = new PageSetupDialog();
            ppd = new PrintPreviewDialog();
            pd = new PrintDialog();
            dlgPageSetup.Document = pdDocument;
            pd.Document = pdDocument;
            ppd.Document = pdDocument;
            pdDocument.PrintPage += new PrintPageEventHandler(pdDocument_PrintPage);