Printing in landscape from a Windows Forms WebBrowser control

社会主义新天地 提交于 2019-12-24 16:17:57

问题


I have a WebBrowser control in a Windows Forms Host in a WPF application. I know that in order to print it's contents, I use simply WebBrowser.Print(), however, how can I tell the printer to print the contents in landscape rather than a portrait orientation? I've been searching the Internet on this and oddly enough, it seems to be actually something that is a bit hard to do -- is this really the case? It seems odd to me that it wouldn't be easily implementable.

Thanks!


回答1:


INFO: WebOCHostCSharp.exe Hosts the WebBrowser Control in C# .NET

http://support.microsoft.com/kb/326217

The Print(String) method prints a document and does not display a dialog box. This method uses a Microsoft HTML (MSHTML) print template to automatically control print options such as paper size, orientation, and number of copies.

Note: This project does NOT contain this mystery overloaded method "Print(string)", It's actually called "PrintFormatted(string)"



来源:https://stackoverflow.com/questions/6335678/printing-in-landscape-from-a-windows-forms-webbrowser-control

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!