简体   繁体   English

C#打印文档

[英]c# printdocument

I am using printDocument to print from a list view. 我正在使用printDocument从列表视图进行打印。 This all works fine. 这一切都很好。 Originally when the print dialog opened I could use the default printer or choose another (such as adobe pdf or send to one-note). 最初,当打开打印对话框时,我可以使用默认打印机或选择其他打印机(例如adobe pdf或发送到一个便笺)。 Now the dialog still displays but no matter what option I choose always prints to the default printer. 现在,对话框仍然显示,但是无论我选择哪种选项,始终会打印到默认打印机。 I haven't intentionally made any changes but may have inadvertently changed a property or something. 我没有有意进行任何更改,但可能无意中更改了属性或其他内容。 Does anyone have any ideas of what I may have done? 有人对我可能做的事情有任何想法吗?

 PrintDialog printDialog = new PrintDialog();
 printDialog.ShowDialog();
 printPreviewDialog1.Document.PrinterSettings = printDialog.PrinterSettings;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM