从C Sharp应用程序使用特定的打印机打印文档 [英] Printing a document using a particular printer from a c sharp application
本文介绍了从C Sharp应用程序使用特定的打印机打印文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的机器上,连接了两台打印机,我想使用其中一台打印机从c Sharp应用程序中打印图像,而不提示打印对话框窗口.我可以通过编程方式选择要打印的打印机而不将其设置为默认打印机吗?
请帮助....
In my machine two printers are connected, I want to print an image from from my c sharp application using one of the printer without prompting the print dialog window. can i select programatically my printer for printing without setting it as default printer?
plz help..........
推荐答案
PrintDocument pd = new PrintDocument();
pd.PrinterSettings.PrinterName =打印机名称";
if(pd.PrinterSettings.IsValid)
pd.Print();
其他
MessageBox.Show(打印机无效.");
PrintDocument pd = new PrintDocument();
pd.PrinterSettings.PrinterName = "printername";
if(pd.PrinterSettings.IsValid)
pd.Print();
else
MessageBox.Show("Printer is invalid.");
这篇关于从C Sharp应用程序使用特定的打印机打印文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文