问题描述
我有Windows窗体中的Web浏览器控件.它加载一个HTML文件.我希望能够为用户提供一个选项,以将其另存为PDF文件.
I have a Web Browser control in Windows forms. It loads a HTML file. I want to be able to give an option to the user to Save this as PDF file.
如果用户安装了"CutePDF Writer",那么我想我可以从打印对话框"中以编程方式选择它并将其另存为PDF.我正在使用Web_browser_control.ShowPrintDialog()显示PrintDialog.是否可以在此打印"对话框中以编程方式选择打印机(在我的情况下为CutePDF Writer),而无需用户干预?
If the user has "CutePDF Writer" installed then I thought I can just select it programmatically from Print Dialog and Save it as PDF. I am showing the PrintDialog using Web_browser_control.ShowPrintDialog(). Is there a way to select a printer(CutePDF Writer in my case) programmatically in this Print Dialog without user intervention?
推荐答案
不太确定,但是打印"对话框具有与打印机设置相关的属性,您可以在其中定义默认打印机.
Not quite sure,but print dialog has printer settings related properties where you can define the default printer.
此处在因此,唯一的区别是有人要求使用Windows.没什么,PrintDialog也可以在网络中以类似的方式工作.
Here is somewhat similar question asked in SO, the only difference being it was asked for windows. Neverthless, PrintDialog works in a similar fashion in web too.
这篇关于在PrintDialog中以编程方式选择打印机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!