从Windows窗体WebBrowser控件横向打印 [英] Printing in landscape from a Windows Forms WebBrowser control

查看:411
本文介绍了从Windows窗体WebBrowser控件横向打印的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在WPF应用程序的Windows Forms Host中有一个WebBrowser控件.我知道为了打印内容,我仅使用WebBrowser.Print(),但是,如何告诉打印机以横向而不是纵向打印内容?我一直在搜索互联网,这很奇怪,这似乎实际上很难做到-确实是这样吗?在我看来,实现起来并不容易.

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.

谢谢!

推荐答案

信息:WebOCHostCSharp.exe在C#.NET中托管WebBrowser控件

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

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

Print(String)方法将打印文档,并且不显示对话框.此方法使用Microsoft HTML(MSHTML)打印模板来自动控制打印选项,例如纸张尺寸,方向和份数.

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.

注意:该项目包含此神秘的重载方法"Print(string)",实际上称为"PrintFormatted(string)"

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

这篇关于从Windows窗体WebBrowser控件横向打印的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆