printDocument
时间: 2023-11-07 20:04:59 浏览: 84
PrintDocument是一个用于打印文档的类,在打印过程中,可以使用PrintDocument组件的PrintPage事件来绘制页面。要使用PrintDocument打印文档,首先需要创建PrintDocument的对象。然后使用PageSetupDialog对话框设置页面打印方式,并使用PrintDialog对文档进行打印时的打印机参数进行设置。在打开这两个对话框之前,需要将对话框的属性Document设置为指定的PrintDocument对象,以便将修改的设置保存到PrintDocument组件中。最后,调用PrintDocument的Print方法来实际打印文档。在调用Print方法后,将引发BeginPrint、PrintPage和EndPrint事件,其中每打印一页都会引发PrintPage事件,如果打印多页,则会引发多次PrintPage事件。此外,还可以使用PrintPreviewDialog和PrintDocument来实现打印预览功能。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [C# 使用自带的组件PrintPreviewDialog 和 PrintDocument实现打印预览(一)](https://blog.csdn.net/weixin_40314351/article/details/130525301)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [【转】C#中PrintDocument类详解](https://blog.csdn.net/weixin_30918633/article/details/96037923)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文