public static void Print(IPrinter printer) { CommonPrinter commonPrinter = new CommonPrinter(printer); //commonPrinter.ShowPreviewPrinter(); GlobalPrintSetting printSetting = StaticCacheManager.GetConfig<GlobalPrintSetting>(); if (printSetting.PrintModel == "ֱ�Ӵ�") { commonPrinter.Print(); } else if (printSetting.PrintModel == "ѡ���ӡ��") { commonPrinter.ShowPreviewPrinter(); } else { commonPrinter.Preview(); } }
private void btnPreview_Click(object sender, EventArgs e) { TemplatePrintObject printer = new TemplatePrintObject(config); CommonPrinter commonPrinter = new CommonPrinter(printer); commonPrinter.SetPaperSize(config.PageWidth, config.PageHeight); commonPrinter.Preview(); }