C#直接调用windows系统的默认打印机进行打印
我的电脑安装了很多台打印机,并设置了默认打印机,现在希望不要弹出打印机设置对话框、对打印机进行选择(感觉多余了),当点击打印按钮时,
直接调用windows系统的默认打印机进行打印。
ApplicationClass lbl = new ApplicationClass();
string a1 = System.Windows.Forms.Application.StartupPath + "\\KSI.Lab";
lbl.Documents.Open(@a1, false);
//以下这条代码会去弹出打印机设置对话框、对打印机进行选择。
//但是如果去掉这句代码,程序又不会去调用windows系统的默认打印机进行打印
bl.Dialogs.Item(LabelManager2.enumDialogType.lppxPrinterSelectDialog).Show();
Document doc = lbl.ActiveDocument;